Jump to content

Converting drop down to radio buttons


niiki-lou

Recommended Posts

Hello everyone!

 

Im working with a form but i need a little help in changing the drop downs to radio buttons but my problem is ive never use radio buttons ive looked at some tutorials but im still a little unsure how to convert

 

<tr><td><p>Show email?</p></td><td><select name='show_email'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option></select></td><td></td></tr>
<tr><td><p>Show age?</p></td><td><select name='show_age'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option></select></td><td></td></tr>

 

Into a radio button option as using drop downs always puts my age and email setting as no when i edit my account if i dont select yes again which i dont want to have to keep doing, Any help is appretiated greatly, Thanks Nikki

Link to comment
Share on other sites

Um...I think this should do it:

Yours:

<select name='show_email'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option>

<select name='show_age'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option></select></select>

 

Radio:

<input type="radio" value="no" name="show_email" checked>No <br/> <input type="radio" value="yes" name="show_email">Yes

<input type="radio" value="no" name="show_age" selected>No <br/> <input type="radio" value="yes" name="show_age">Yes

 

;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.