T
TeknoShock
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="javascript" >
function decideWhoToMailTo(dform) {
if (document.dform.ru.value == "122") {
document.dform.param_pie = "(e-mail address removed)";
} else if (document.dform.ru.value == "144") {
document.dform.param_pie = "(e-mail address removed)";
}
}
</script>
-----------------------------
<FORM name="dform"
ACTION="http://intranet.mycompany.org/cgi-bin/purchase2.pl" METHOD=POST
onsubmit="decideWhoToMailTo(this);" >
<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 (e-mail address removed).
on what a user inputs for another value. It is not working correctly.
Here is the relevant code:
---------------------------
<script language="javascript" >
function decideWhoToMailTo(dform) {
if (document.dform.ru.value == "122") {
document.dform.param_pie = "(e-mail address removed)";
} else if (document.dform.ru.value == "144") {
document.dform.param_pie = "(e-mail address removed)";
}
}
</script>
-----------------------------
<FORM name="dform"
ACTION="http://intranet.mycompany.org/cgi-bin/purchase2.pl" METHOD=POST
onsubmit="decideWhoToMailTo(this);" >
<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 (e-mail address removed).