• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Is it Javascript in forms?

imported_KuJaX

Platinum Member
Is it Javascript that people use in forms to show something else once you selected something.

For example: On many car sites, you click on a car make ("Honda") and then the "Model" below it populates with Honda Models.

How does that work, and any references/links to tutorials? I want to create a form with the information:

Method of Contact = *E-Mail/Phone* <--options

If they select Phone, a new LINE or table row appears with another little form input stating = Best time to call = *ASAP/5min/15min/tommorrow*
 
Not sure how the site in question does it but there are a couple of ways, although all involve Javascript to some degree. One way is to generate the required Javascript from your server side script (assuming the information is stored in a database.). A btter way to do it, assuming you have a huge amount of data, would be to use AJAX.

Your case seems much easier, if I understood it right. Assuming your form looks something like what I did, Here is one way to do it:
Hopefully I didn't make any syntax errors, if it doesn't work right just post back..





 
Back
Top