Code: Select all
<script language=JavaScript type="text/javascript">
{
var a="null";
function check()
{
if (document.a.c.value == a)
{
document.location.href="/"+document.a.c.value+".htm";
}
else
{
alert ("Try again");
}
}
}
</script>
Code: Select all
<form name="a" action="javascript:check()">
<input type="text" name="c" maxlength="25" size="16"><br>
<br>
<input type="submit" value=" Log In ">
</form>
The form side i understand.
It consist of the form which is referred to as "a" and text box inside the form which is referred to as "c"
with the submit button which is the validation of the form's text box
When pressing the submit button of the form it calles the "Java function" called "check"
Now.
Code: Select all
document.a.c.value == a
.a -- The form ?
.c -- The Textbox ?
is it saying
if the textbox value "c" in Form "a" has the string/value of "a" typed in the box then
document.location.href="/"+document.a.c.value+".htm";
or else
alert ("Try again"); whicj is a message box.
?
Edit
Will the string value result of
document.location.href="/"+document.a.c.value+".htm"
be "/a.htm" ??