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="javasc ript:test(field 1.value,field2. value)"/>
</div>
</form>
SCRIPT
<script type="javascrip t">
<!--
function test(field1,fie ld2)
{
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="javasc ript:test(field 1.value,field2. value)"/>
This part of the line is highlighted when in debug:
javascript:test (field1.value,f i
I know I have probably done something really simple, please help!
HTML
<form method="post" action="" >
<div>
<input type="text" name="field1"/>
<input type="password" name="field2"/>
<input type="button" name="submit" value="Click" onclick="javasc ript:test(field 1.value,field2. value)"/>
</div>
</form>
SCRIPT
<script type="javascrip t">
<!--
function test(field1,fie ld2)
{
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="javasc ript:test(field 1.value,field2. value)"/>
This part of the line is highlighted when in debug:
javascript:test (field1.value,f i
I know I have probably done something really simple, please help!
Comment