Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript: Seeing if checkbox/radio is selected
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 15 June 2004 :  23:03:58  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I have been using the below code to find out if text boxes are emtpy and if they are it does another function. I can give you the link to the full page, but basically I need to just have another if/then statment to check if a radio button was select and another one if a check box was selected. Can someone help me out?


			if(document.TravelForm.ZipCode.value.length>0)
			{

			}else{
				changeImage("ImgZipCode", "/images/error_yellow.gif");
				isValidSubmit = false;
			}

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 16 June 2004 :  00:21:15  Show Profile
document.FormName.CheckOrRadioName.checked == false;

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 16 June 2004 :  00:47:15  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I just tried and got an error..


			if(document.TravelForm.CellPhoneNone.checked == false;)
			{
				window.confirm("It was not checked");
			}else{

			}

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 16 June 2004 :  00:48:49  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Nevermind I just saw it when I looked at this post..

if(document.TravelForm.CellPhoneNone.checked == false;)

i removed the code in red and it worked fine. Thanks

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 16 June 2004 :  00:55:51  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I just tried it on a radio button using this JS..


if(document.TravelForm.Sex.checked == false)
{
	window.confirm("yes sex");
}else{
	window.confirm("no sex");
}


and the html looks like....

<INPUT type="radio" value="M" name="Sex" onChange="hasChanged()"> Male<br>
<INPUT type="radio" value="F" name="Sex" onChange="hasChanged()">  Female

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07