Form conditional fields problem
Hello;
I have a select box with option
Newsletter unsubscription, if selected, then show the class unsuscribereason and hide classe message else then do the reverse. The code below works fine when i click on the option
Newsletter unsubscription, the problem is that this condition didn't affect the form if :
- I just visited the page where form is located;
- When i reload the page.
jQuery only apply the condition when i click an option and didn't set it as default for the form whatever situation. So i don't know how to adapt this code, maybe .change event should be replaced by something else ?
- jQuery('#Subject').change(function(){
- if(jQuery(this).val() == "Newsletter unsubscription")
- {
- jQuery('.unsuscribereason').show();
- jQuery('.message').hide();
- }else
- {
- jQuery('.unsuscribereason').hide();
- jQuery('.message').show();
- }
- });