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
https://forums.phpfreaks.com/topic/164783-converting-drop-down-to-radio-buttons/
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

 

;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.