Yes Alsvha is correct as usual!
You could try something like:
PHP Code:
<HTML>
<HEAD>
<TITLE>JAVASCRIPT</TITLE>
</HEAD>
<script language = "JavaScript">
function CalculateTotalImpact(){
alert( document.form.Test2.value);
}
</script>
<BODY>
<FORM>
<input id="Test1" type="text" value = "" onchange = "CalculateTotalImpact()" >
<input id="Test2" type="text" value = "" onchange = "CalculateTotalImpact()" />
<INPUT TYPE="button" ONCLICK="CalculateTotalImpact()" VALUE="click to say hello">
</FORM>
</BODY>
</HTML>
Give that a try.
I just have a couple of issues with your code.
The Head tag- I'm old fashioned, but it makes for better proper reading when included
You don't have to say:
PHP Code:
<script language = "JavaScript" type="text/javascript">
You could use either
PHP Code:
<script language = "JavaScript">
or
PHP Code:
<script type="text/javascript">
As far as I know the language attribute will eventually be replaced with : type="text/javascript", so it's actaully better to use it instead of language.
PHP Code:
<input id="Test1" type="text" value = "" onchange = "CalculateTotalImpact()" />
I may be wrong, but the Input tag is not a container tag, meaning that it doesn't have a closing tag. You don't need to include the "/" in there it just needs to be:
PHP Code:
<input id="Test1" type="text" value = "" onchange = "CalculateTotalImpact()" >
I hope these comments were useful