Hi,
I have 2 select fields in my search form:
1) Region
2) Department
… the department depends on the region. So for example, if in region ‘worcestershire’ is selected, then department needs to only list the departments in that region rather than displaying the full list.
I have nearly solved this issue by using jQuery. I am using:
jQuery('.sf-field-post-meta-region .sf-input-select').change(function(){
if(jQuery(this).val() == "1"){
jQuery('.sf-field-post-meta-department').fadeIn();
}
else{
jQuery('.sf-field-post-meta-department').hide();
}
});
… so if the value is ‘1’ in the .sf-field-post-meta-region > .sf-input-select field, then display .sf-field-post-meta-department .
I was going to create all the dropdowns for departments manually so if ‘1’ show .sf-field-post-meta-department, if ‘2’ show .sf-field-post-meta-department-othername etc etc…
the only issue with this method is there is no way to add a unique class to the field making it impossible for jQuery to ‘select’ the class I want to show/ hide.
Is there a way to do add custom classes to my meta select fields or perhaps a different method to achieve what I am after?
Thanks!!