Hi there
I have this function that I am trying to make work and I cannot.
The aim of the function is to pass to it both the the ID of a textbox and the contents (value) of the same textbox.
The value of the textbox is checked against another letter and the results is displayed back into the same textbox
The code I am using is below and when I run it I get the value of the first text for whatever I put into any of the textboxes.
Quote:
<script language="JavaScript" type="text/javascript"><!--
function myreply(currentField)
{
if (currentField.value == ("y") || ("Y"))
{
currentField.value="Great";
}
else if (currentField.value == ("n") || ("N"))
{
currentField.value="Sorry";
}
else if (currentField.value == ("m") || ("M"))
{
currentField.value="Check back later";
}
}
//--></script>
|
<
Quote:
FORM name="form1">
INPUT NAME="v1" SIZE=20 onchange="myreply(v1)" maxlength="20" >
<INPUT NAME="v2" SIZE=20 onchange="myreply(v2)" maxlength="20" >
<INPUT NAME="v3" SIZE=20 onchange="myreply(v3)" maxlength="20" >
</FORM>
|
Whenever I run this when I type in any of the 3 boxes I get the "Great" in that box.
If I type "N" into v2 I get "Great" in v2 suppose to be Sorry
"m" into v3 I get "Great" in v3 suppose to be Check back later
"N" into v1 I get "Great" in v1 suppose to be Sorry
any suggestions?