I am trying to use an if then in javascript to change one value based
on what a user inputs for another value. It is not working correctly.
Here is the relevant code:
---------------------------
<script language="javas cript" >
function decideWhoToMail To(dform) {
if (document.dform .ru.value == "122") {
document.dform. param_pie = "me@mycompany.o rg";
} else if (document.dform .ru.value == "144") {
document.dform. param_pie = "yo*@mycompany. org";
}
}
</script>
-----------------------------
<FORM name="dform"
ACTION="http://intranet.mycomp any.org/cgi-bin/purchase2.pl" METHOD=POST
onsubmit="decid eWhoToMailTo(th is);" >
<INPUT TYPE="hidden" name="param_pie ">
RU: <input type="text" name="ru" value="122" tabindex="2">
----------------------------
I then passed the param_pie to the cgi script just to see what it is
being set to. It is being set to blank.
Can you see where I went wrong? I am leaving the ru set to the default
value of 122, so I would expect param_pie to be set to me@mycompany.or g.