I have the following code:
[CODE]
<SCRIPT LANGUAGE=”JavaScript” TYPE=”TEXT/JAVASCRIPT”>
<!–
function post45 ()
{
alert(+ myForm.firstname.value +);
document.bgColor=”#EEEEEE”;
}
//–>
</SCRIPT>
<form name=”myForm”>
<table border=”0″>
<tr>
<td><label for=”firstname”>Firstname:</label></td>
<td><input type=”text” name=”firstname” id=”firstname”></td>
</tr>
<tr>
<td></td>
<td><input type=”button” value=”Close” onclick=”closeMessage()”>
<input type=”button” value=”Send” onclick=”post45(myForm)”></td>
</tr>
</table>
<script type=”text/javascript”>
document.myForm.firstname.focus();
</script>
</form>
I am trying to get the value entered into the firstname box appear on an alert box when the send button is pressed.
With the above code the alert box dosnt display but if i take away the + myForm.firstname.value + from the java script it displays the alert box.