I am trying to create a simple login routine, and am failing completely, I have tried to simplify the test and still no luck.
HTML
<form method="post" action="" >
<div>
<input type="text" name="field1"/>
<input type="password" name="field2"/>
<input type="button" name="submit" value="Click" onclick="javascript:test(field1.value,field2.value )"/>
</div>
</form>
SCRIPT
<script type="javascript">
<!--
function test(field1,field2)
{
echo "in the test<br>";
alert ("i am in the code");
return;
}
//-->
</script>
ERROR
Microsoft JScript runtime error: Object expected
<input type="button" name="submit" value="Click" onclick="javascript:test(field1.value,field2.value )"/>
This part of the line is highlighted when in debug:
javascript:test(field1.value,fi
I know I have probably done something really simple, please help!