2004028
11-17-2004, 09:23 AM
Hello everyone.
I have a form call myForm, I have a text area in this form. I want to take the value that the visitor inputed and show the value in the same window as the visitor click submit button. How can I do it?
I tryed this way;(didn't work)
<body>
<scrpit type="text/javascript">
function Balance()
{
money = document.myForm.money.value;
submitOK = "True";
if (money <= 0)
{
alert("You don't have money? Go away!");
return false;
}
}
</script>
<table>
<form name="myForm" onsubmit="return Balance()">INSERT MONEY<br><input name="money" type="text" size="10">
<br><input type="submit" value="Submit"></form></td>
<td colspan="2"><form name="balance">Your balance is:<script type="text/javascript">document.write(document.myForm.money.value)</script></form></td>
</tr>
</table>
</body>
This will give me a error says document.myForm.money.value is null.
How can I fix it?
I have a form call myForm, I have a text area in this form. I want to take the value that the visitor inputed and show the value in the same window as the visitor click submit button. How can I do it?
I tryed this way;(didn't work)
<body>
<scrpit type="text/javascript">
function Balance()
{
money = document.myForm.money.value;
submitOK = "True";
if (money <= 0)
{
alert("You don't have money? Go away!");
return false;
}
}
</script>
<table>
<form name="myForm" onsubmit="return Balance()">INSERT MONEY<br><input name="money" type="text" size="10">
<br><input type="submit" value="Submit"></form></td>
<td colspan="2"><form name="balance">Your balance is:<script type="text/javascript">document.write(document.myForm.money.value)</script></form></td>
</tr>
</table>
</body>
This will give me a error says document.myForm.money.value is null.
How can I fix it?