View Full Version : Linking Select Options to Hidden Recipient Fields

10-29-2004, 04:36 PM

I am using a FormMail script but want the form to have a drop down and dependant on the choice of the dropdown a different receipient value will be used in the hidden field which tells the perl script where to send the form results.

Hope that is clear.

I have been trying to index the form and then use document.write to input the correct line of html dependant on the select option. This is not working.

Can anyone suggtest a method that will do this.


10-29-2004, 05:25 PM
[potential silly question]

Why are you using hidden fields? Why not simply use the value attribute of the drop-down to store the recipient info?

[/potential silly question]

To do it with hidden fields, you could number the options in the drop-down 1, 2, 3 .... etc.

Then your corresponding hidden fields have id 1, 2, 3 ... etc.

Your perl script simply needs to look at the value returned from the drop-down and then pick the recipient value from the hidden field with the corresponding id.