yasmeencarter
10-18-2003, 07:41 PM
I need to have "Chk1" checkbox check the first time the person logs in the page, and the rest is either checkbox 1 or 2 just like I have.. This is for a search textbox , which you could search by lastname or firstname.
. The only problem is to have checkbox 1 checked the first time,, could someone help with that. thanks
<SCRIPT LANGUAGE="JavaScript">
function setChecked(checkName)
{
var doc = document.Compaq;
if (checkName == "chk1")
{
doc.Chk2.checked = 0;
}
else
if (checkName == "chk2")
{
doc.Chk1.checked = 0;
}
}
</SCRIPT>
<FORM METHOD="POST" ACTION="test.cfm" NAME="Compaq">
<INPUT TYPE="CHECKBOX" NAME="Chk1" VALUE="1" ONCLICK="setChecked('chk1')">Check 1
<INPUT TYPE="CHECKBOX" NAME="Chk2" VALUE="2" ONCLICK="setChecked('chk2')">Check 2
</FORM>
. The only problem is to have checkbox 1 checked the first time,, could someone help with that. thanks
<SCRIPT LANGUAGE="JavaScript">
function setChecked(checkName)
{
var doc = document.Compaq;
if (checkName == "chk1")
{
doc.Chk2.checked = 0;
}
else
if (checkName == "chk2")
{
doc.Chk1.checked = 0;
}
}
</SCRIPT>
<FORM METHOD="POST" ACTION="test.cfm" NAME="Compaq">
<INPUT TYPE="CHECKBOX" NAME="Chk1" VALUE="1" ONCLICK="setChecked('chk1')">Check 1
<INPUT TYPE="CHECKBOX" NAME="Chk2" VALUE="2" ONCLICK="setChecked('chk2')">Check 2
</FORM>