I recently encountered a situation with a website we were working on and, yes, I know that there are hundreds of lines of code out there that do exactly what I am about to discuss, but to me, this is probably the simplest solution and could be easily configured to do what you need it to do.
What was needed you ask? Well, a simple thing really. The client wanted their request form to be a little intuitive.
If their users selected an option from the dropdown that was the U.S,
then show the U.S. States; if not, then show a textbox for the user to input their area, city, whatever. Granted there is no Database associated with this site, nor did they want one created. So I wrote this little piece to make it do just that.
So to begin let's grab some stuff you need.
»
Read More