radio button, being selected from creation

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

radio button, being selected from creation

Post by Mythic Fr0st »

Heres my problem

I have 2 radio buttons, how do I make one appear selected

E.G

Male/female button

Male O female O

how do I make Male O radio button, appear selected? so you have to change it if your a girl, but so you
cant leave it blank ?

- edit, or is their anyway to CHECK if a radio button has been selected with PHP

right now, you click sign up, it goes to the next page, and displays if username is right, password & confirm password is right, & password & confirm password match & e-mail & confirm e-mail match

is there a way like to detect if a radio button has been selected (preferably using PHP if possible, but anything else is better )
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There's a property called "checked."

If neither is selected the browser will submit nothing or erroneous data. You may need isset() on the PHP side.
Mythic Fr0st
Forum Contributor
Posts: 137
Joined: Sat Dec 02, 2006 3:23 am
Contact:

ty

Post by Mythic Fr0st »

thanks
Post Reply