Note that there are some explanatory texts on larger screens.

plurals
  1. POLiveValidation + UI TAbs - one page with multiple validations
    primarykey
    data
    text
    <p>I'm using LiveValidation of livevalidation.com for some simple and more complicated form validation on most of my projects.</p> <p>Mostly to enhance user expirence.</p> <p>What I did. - replace invalid message from text to image - when form is submited - and is not valid - focus on first not valid input field - when form is submited - and is not valid - add red border to all not valid fields</p> <p>What I'm trying to do: - create function which be validating form - but for only on current tab</p> <p>How can we do that 'manualy' - We could create another var automaticOnSubmit2 = field4.form.onsubmit;</p> <p>Where field4 is always first input on current tab. Because my tabs would be generated with unknown number of tabs - I'm looking for more universal solution.</p> <p>I did some attempts - but my knowledge of js/jquery is very poor - so I failed.</p> <p>//attempt 1</p> <pre><code>$(".ui-tabs-panel:not(.ui-tabs-hide) &gt; form") </code></pre> <ul> <li><p>that is correct - firebug can found only 1 - open/current tab - where form which we wants to validate is located </p> <pre><code>$(".ui-tabs-selected").ready(function() { var automaticOnSubmit = $(".ui-tabs-panel:not(.ui-tabs-hide) &gt; form").submit; $(".ui-tabs-panel:not(.ui-tabs-hide) &gt; form").submit = function(){ var valid = automaticOnSubmit(); if(valid)alert('Form is Valid!'); else{ $(".LV_invalid_field:first", document.forms).focus(); } return false } </code></pre> <p>});</p></li> </ul> <p>Best Regards,</p> <p>Peter</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload