Hello all,

I am just switching to JQuery from prototype and am trying to use the
Validation and Tabs plugins for JQuery. Here's my problem:

I have one form tag in which I have my tabs container. Using a dynamic
language I am creating multiple tabs for user chosen data, say states.
So if the user has chosen 5 states, there are five tabs with the same
form fields with the "_statename" appended to the end of the field
name.

So, if the user enters data, validates the form and click on continue
nothing happens as the user has not touched the other tabs. But, the
user doesn't know about this and it is a confusion. Is there a way to
select the right tab depending on which tab the validator throws an
error in?

Any help would be greatly appreciated.

I am using the following code:



<script type="text/javascript">
         $(function() {

             $('##tabs_container > ul').tabs({ fx: { opacity:
'toggle' } });
         });
     </script>

<script type="text/javascript">

$().ready(function() {

$("##general").validate({
rules: {
        <cfloop list="#stateslist#" index="sta">
                <cfset sta = ReplaceNoCase(sta,' ','','All')>
                products_#sta#: "required"
                osda_#sta#: "required",
        </cfloop>

},
messages: {
        <cfloop list="#stateslist#" index="sta">
                <cfset sta = ReplaceNoCase(sta,' ','','All')>
        products_#sta#: "Choose product";
                osda_#sta#: " Please choose YES OR NO."
        </cfloop>

}
});


});

</script>


Thanks
-P

Reply via email to