New Problem, i tested on a new html page and it works, but now i putted it in my page, i can''t get it work, here is the code for the input boxes:
<DIV Class="transbox"><P>
<DIV Align="Right">
<Form Name="Login">
Username: <INPUT Type="Text" Maxlength=11 Name="UsernameField" Style="WIDTH: 80px; HEIGHT: 20px" Size=11 Id="Username"/>
Pass: <INPUT Type="Password" Maxlength=11 Name="PasswordField" Style="WIDTH: 80px; HEIGHT: 20px" Size=11 Id="Password" /> <BR>
</Form>
<FORM NAME="this">
Onthoud: <INPUT TYPE="checkbox" NAME="check1" VALUE="Check1">Username
en/of <INPUT TYPE="checkbox" NAME="check2" VALUE="Check2">Password <BR>
<A Href="">Password vergeten?</A> <INPUT TYPE="button" VALUE="Click" onClick="testButton(this.form, this.form.UsernameField.value, this.form.PasswordField.value)">
</FORM></DIV></P></DIV>
And here is the code for the function:
<SCRIPT Language="Text/JavaScript">
function testButton(form, Username, Password) {
var alertStr = "";
for (Count = 0; Count < 2; Count++) {
if (form[Count].checked) alertStr += "CheckBox " + (Count + 1) + " is checked";
}
// if (alertStr == "") alertStr = "No CheckBox was selected";
if (!alertStr) alertStr = "No CheckBox was selected";
alert(alertStr);
if (alertStr == "No CheckBox was selected")
{
}
else if(alertStr == "CheckBox 1 is checkedCheckBox 2 is checked")
{
alert(Username + " & " + Password)
}
else if(alertStr == "CheckBox 1 is checked")
{
alert("Username: " + Username)
}
else if(alertStr == "CheckBox 2 is checked")
{
alert("Password: " + Password)
}
}
</SCRIPT>
Please help me with my last question!!!!!