
Chapter 15. Protection of external Web resources 355
Example 15-6 shows an extract of the code with those changes.
Example 15-6 Forms-based authentication and required changes
...
<script language='javascript'>
function submitForm(formValue,form)
{
var username = document.index.username.value;
var pass = document.index.password.value;
if (formValue == 0)
{
if((username == "") || (pass == ""))
{ alert("please enter all fields.");
formValue = 1;
}
else
{ document.index.action="/pkmslogin.form";
document.index.submit();
}
} //end of if form value==0
else
{ document.index.reset();
}
}
function myInputType(frm)
{
var myVal=frm.username; ...