How to makeSelect box blanks other questions when selected


(Callum Gorringe) #1

Hi all, first post hopefully someone can shed some light.  I have a custom form, fairly basic and I have a country select box.  This has been pre filled with every country (by Squiz default).  My question, is there anyway to blank other fields when a certain option is selected?

 

For E.G if someone picks any country other than Australia in my case, I dont want them to have access or need to select a State, Postcode and maybe even address, I'd like them greyed out when you pick anything other than Australia, hope someone can help and hope this made sense!  Thanks heaps.


(Bart Banda) #2

Your best option here is probably to use some jQuery on the select drop down. So on change, if it is not Australia, hide the other fields, else, show them. http://api.jquery.com/change/

 

Hope that helps.


(Callum Gorringe) #3

Brilliant thanks for the quick reply, I'm going to show your link to someone who knows more about this stuff than I do!  Hopefully he can help show where this code would/should sit etc, thanks again!