PDA

View Full Version : Select an email address to send a form to



jianxin9
07-02-2007, 05:55 PM
Hi everyone,

Is it possible to use javascript in a form to create something like the following:

Please select the department you'd like your question to go to:
Then have a radio button/drop down menu selection of departments--when a department is selected and the submit button on the form is pressed the form will only go to that particular email address?

Thanks for any suggestions.

alexjewell
07-02-2007, 06:01 PM
You could have a hidden input with the email address as the value, and have the value change depending on which radio button/drop down item is picked.

jianxin9
07-02-2007, 06:47 PM
Thanks for the response! Stupid question...what would I need to do get the value to change?

alexjewell
07-02-2007, 07:52 PM
Nah, not a stupid question. I'm not very good at writing JavaScript, but I have a good understanding of what you can and cannot do with it.

Basically, what you want to do is something like if radio button equals, say, Robert, input.value='this'. If radio button equals Joey, input.value='that'

Make sense? The input.value='whatever' isn't totally right, but it's the basic idea.

Twey
07-02-2007, 07:55 PM
Do all the checking in your server-side script. Do not pass an email address straight to the server-side script from the client-side.

jianxin9
07-05-2007, 01:26 PM
Thanks for the help everyone.