|
339 | 339 | errorFound |= methods._validateField(field, options);
|
340 | 340 | if (errorFound && first_err==null)
|
341 | 341 | if (field.is(":hidden") && options.prettySelect)
|
342 |
| - first_err = field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix); |
343 |
| - else |
344 |
| - first_err=field; |
| 342 | + first_err = field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix); |
| 343 | + else { |
| 344 | + |
| 345 | + //Check if we need to adjust what element to show the prompt on |
| 346 | + //and and such scroll to instead |
| 347 | + if(field.data('jqv-prompt-at') instanceof jQuery ){ |
| 348 | + field = field.data('jqv-prompt-at'); |
| 349 | + } else if(field.data('jqv-prompt-at')) { |
| 350 | + field = $(field.data('jqv-prompt-at')); |
| 351 | + } |
| 352 | + first_err=field; |
| 353 | + } |
345 | 354 | if (options.doNotShowAllErrosOnSubmit)
|
346 | 355 | return false;
|
347 | 356 | names.push(field.attr('name'));
|
|
1507 | 1516 | * @param {Map} options user options
|
1508 | 1517 | */
|
1509 | 1518 | _showPrompt: function(field, promptText, type, ajaxed, options, ajaxform) {
|
| 1519 | + //Check if we need to adjust what element to show the prompt on |
| 1520 | + if(field.data('jqv-prompt-at') instanceof jQuery ){ |
| 1521 | + field = field.data('jqv-prompt-at'); |
| 1522 | + } else if(field.data('jqv-prompt-at')) { |
| 1523 | + field = $(field.data('jqv-prompt-at')); |
| 1524 | + } |
| 1525 | + |
1510 | 1526 | var prompt = methods._getPrompt(field);
|
1511 | 1527 | // The ajax submit errors are not see has an error in the form,
|
1512 | 1528 | // When the form errors are returned, the engine see 2 bubbles, but those are ebing closed by the engine at the same time
|
|
0 commit comments