|
342 | 342 | errorFound |= methods._validateField(field, options);
|
343 | 343 | if (errorFound && first_err==null)
|
344 | 344 | if (field.is(":hidden") && options.prettySelect)
|
345 |
| - first_err = field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix); |
346 |
| - else |
347 |
| - first_err=field; |
| 345 | + first_err = field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix); |
| 346 | + else { |
| 347 | + |
| 348 | + //Check if we need to adjust what element to show the prompt on |
| 349 | + //and and such scroll to instead |
| 350 | + if(field.data('jqv-prompt-at') instanceof jQuery ){ |
| 351 | + field = field.data('jqv-prompt-at'); |
| 352 | + } else if(field.data('jqv-prompt-at')) { |
| 353 | + field = $(field.data('jqv-prompt-at')); |
| 354 | + } |
| 355 | + first_err=field; |
| 356 | + } |
348 | 357 | if (options.doNotShowAllErrosOnSubmit)
|
349 | 358 | return false;
|
350 | 359 | names.push(field.attr('name'));
|
|
1510 | 1519 | * @param {Map} options user options
|
1511 | 1520 | */
|
1512 | 1521 | _showPrompt: function(field, promptText, type, ajaxed, options, ajaxform) {
|
| 1522 | + //Check if we need to adjust what element to show the prompt on |
| 1523 | + if(field.data('jqv-prompt-at') instanceof jQuery ){ |
| 1524 | + field = field.data('jqv-prompt-at'); |
| 1525 | + } else if(field.data('jqv-prompt-at')) { |
| 1526 | + field = $(field.data('jqv-prompt-at')); |
| 1527 | + } |
| 1528 | + |
1513 | 1529 | var prompt = methods._getPrompt(field);
|
1514 | 1530 | // The ajax submit errors are not see has an error in the form,
|
1515 | 1531 | // 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