Forum Moderators: coopster & phranque

Message Too Old, No Replies

FormMail.cgi field changes based on choices

How do I have additional fields pop up based on choices?

         

gdguide

3:59 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



Hi all,

I'm running FormMail.cgi , and my client now wants people to select an option from a pulldown menu, and based on their choice, a new related text field will show up.

So, they want a "How did you hear about Us?"

-Radio
-TV
-Internet

If you select Radio, a text field below would change to
"Which Radio Station?"

Is this possible in FormMail.cgi?

Thanks for any kind of help on this one. The client wants to know soon. I haven't seen options for this on any FormMail.cgi manual or anything.

Brian

coopster

4:42 pm on Feb 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You would have to modify your process to check for the existence of that variable's value and then prompt the user for the additional value desired. This can all be done in a client-side scripting language such as JavaScript, but you will want to make the modifications in your server-side script as well for those folks that have JavaScript disabled in their browser or those who try to bypass the request for the additional value.

perl_diver

7:15 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



this is poaaible using the script you have, but only if you do it all server side. It would be better to do it client-side though with javascript as coopster noted. Ask in the javascripting forum about how to do it. But you will need to add the additional form fields into your cgi script if you want to get the results of the data into your script.

rocknbil

8:07 pm on Feb 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry if this strays from the topic but anyone using formmail needs to read this thread [webmasterworld.com] and many more like it on WebmasterWorld.

perl_diver

8:27 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



note my above thread:

poaaible = possible

good stuff rocknbil