Toggle based on Default Form Values
Hello,
I am having a problem here..
I have a form that gets automatically filled based on the values returned by my php file.
Then the form elements have their values filled.
Now the problem is, I have set few additional show and hide <div> tags based on the values of some other fields.
So when the form loads, the <div> tag doesnt show up and stays hidden only as the event that activates it is based on the radio button's change event function.
So my question is, as the form loads, how can I have these <div> show/hide based on the default values of the text fields on which they depend upon....
- jQuery(document).ready( function()
- {
- jQuery(".hidden, .error").hide();
-
-
- // This only gets activated when the radio button is changed but i want this to be checked on change as well as based on initial values... How do I do that ?
- jQuery( jQuery("input[name='ssc_appear']") ).change( function()
- {
- if ( jQuery("input[name='ssc_appear']:checked" ).val() == "yes" )
- {
- jQuery("#ssc_details").show();
- }
- else
- {
- jQuery("#ssc_details").hide();
- }
- });
- });