elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

Is there a way to check if the field is already hidden?? #154

Open sumeetwork opened 11 years ago

sumeetwork commented 11 years ago

Hi, I am working on a form obviously :), I am working on a function that if a option from a dropdown list is selected some of the fields get hidden and if the other option are selected the fields come back again... for obvious reasons toggle and remove is not working, is there a way to show the hidden fields with validations??

please help :)

Code:

$('#emp-status').change(function(){ if($('#emp-status').val() == 'not-employed'){ $myform.toggleFields([ 'emp-bussiness-name', 'emp-bussiness-phone', 'emp-address1', 'emp-city', 'emp-province', 'emp-country', 'emp-postal-code' ]) } else{ $myform.toggleFields([ 'emp-bussiness-name', 'emp-bussiness-phone', 'emp-address1', 'emp-city', 'emp-province', 'emp-country', 'emp-postal-code' ]) } });