Jump to content

[SOLVED] Change drop down box select to <input type="radio">


Recommended Posts

Not sure if this is the right place to post...all my pages are in php.

 

Im trying to change my dropdown boxes to radio buttons but I cant get anywhere and its driving me insane :o

 

Heres my original code:

 

<?php if(!isset($_REQUEST['type']) || $_REQUEST['type']=="Web") { ?>

<form name="form1" method="get" action="redir.php">

     <table width="100%" height="3"  border="0" cellpadding="0" cellspacing="0">

        <tr >

          <td height="18" align="center">             <input name="search" type="text" id="search" value="<?php if(isset($_REQUEST['search'])) echo $_REQUEST['search']; ?>" size="60"> <input name="type" type="hidden" id="type" value="<?php echo $type; ?>"> <input class=search type="submit" name="Submit" value="Web Search">            </td>

          </tr>

        <tr >

          <td height="17" align="center"> <form>
					<span style="VERTICAL-ALIGN: bottom">Select a Platform: </span><select onchange="if (this.options[this.selectedIndex].value!='') location = this.options[this.selectedIndex].value;" name="menu">
					<option value="javascript:Determine('Web','1');">Web</option>
					<option value="javascript:Determine('Images','0');">Images</option>
					<option value="javascript:Determine('Audio','0');">Audio</option>
					<option value="javascript:Determine('Video','0');">Video</option>
					<option value="javascript:Determine('News','0');">News</option>
					<option value="javascript:Determine('Sport','0');">Sport</option>
					<option value="javascript:Determine('Blogs','0');">Blogs</option>
					<option value="javascript:Determine('Forums','0');">Forums</option>
					<option value="javascript:Determine('Kids','0');">Kids</option>						</select></td>

          </tr></table></form>

 

 

I just want to change it to radio select buttons:

 

<input type="radio" value="V1" checked name="R1">

 

I have no idea what im doing.....any ideas??

 

Link to comment
https://forums.phpfreaks.com/topic/73291-solved-change-drop-down-box-select-to/
Share on other sites

OK heres the original code:

 

<?php if(!isset($_REQUEST['type']) || $_REQUEST['type']=="Web") { ?>

<form name="form1" method="get" action="redir.php">

     <table width="100%" height="3"  border="0" cellpadding="0" cellspacing="0">

        <tr >

          <td height="18" align="center">             <input name="search" type="text" id="search" value="<?php if(isset($_REQUEST['search'])) echo $_REQUEST['search']; ?>" size="60"> <input name="type" type="hidden" id="type" value="<?php echo $type; ?>"> <input class=search type="submit" name="Submit" value="Web Search">            </td>

          </tr>

        <tr >

          <td height="17" align="center"> <form>
					<span style="VERTICAL-ALIGN: bottom">Select a Platform: </span><select onchange="if (this.options[this.selectedIndex].value!='') location = this.options[this.selectedIndex].value;" name="menu">
					<option value="javascript:Determine('Web','1');">Web</option>
					<option value="javascript:Determine('Images','0');">Images</option>
					<option value="javascript:Determine('Audio','0');">Audio</option>
					<option value="javascript:Determine('Video','0');">Video</option>
					<option value="javascript:Determine('News','0');">News</option>
					<option value="javascript:Determine('Sport','0');">Sport</option>
					<option value="javascript:Determine('Blogs','0');">Blogs</option>
					<option value="javascript:Determine('Forums','0');">Forums</option>
					<option value="javascript:Determine('Kids','0');">Kids</option>						</select></td>

          </tr></table></form>

 

 

And heres what im trying to do:

 

<?php if(!isset($_REQUEST['type']) || $_REQUEST['type']=="Web") { ?>

<form name="form1" method="get" action="redir.php">

     <table width="100%" height="3"  border="0" cellpadding="0" cellspacing="0">

        <tr >

          <td height="18" align="center">             <input name="search" type="text" id="search" value="<?php if(isset($_REQUEST['search'])) echo $_REQUEST['search']; ?>" size="60"> <input name="type" type="hidden" id="type" value="<?php echo $type; ?>"> <input class=search type="submit" name="Submit" value="Web Search">            </td>

          </tr>

        <tr >

          <td height="17" align="center">

                    <input type="radio" value="javascript:Determine('Web','1');" checked >Web</input> 
					<input type="radio" value="javascript:Determine('Images','0');">Images</input>
					<input type="radio" value="javascript:Determine('Audio','0');">Audio</input>
					<input type="radio" value="javascript:Determine('Video','0');">Video</input>
					<input type="radio" value="javascript:Determine('News','0');">News</input>
					<input type="radio" value="javascript:Determine('Sport','0');">Sport</input>
					<input type="radio" value="javascript:Determine('Blogs','0');">Blogs</input>
					<input type="radio" value="javascript:Determine('Forums','0');">Forums</input>
					<input type="radio" value="javascript:Determine('Kids','0');">Kids</input>	</td>

          </tr></table></form>

I wanted to selct a radio button and it changes like the dropdown boxes do kinda like a hyperlink

 

I was looking at :

 

<select onchange="if (this.options[this.selectedIndex].value!='') location = this.options[this.selectedIndex].value;" name="menu">

 

And thought i might be alble to do this with radio buttons

Found the solution:

 

			<input type="radio" onclick="javascript:Determine('Web','1');"  checked>Web</input>
					<input type="radio" onclick="javascript:Determine('Images','0');"  >Images</input>
                   	<input type="radio" onclick="javascript:Determine('Audio','0');">Audio</input>
					<input type="radio" onclick="javascript:Determine('Video','0');">Video</input>
					<input type="radio" onclick="javascript:Determine('News','0');">News</input>
					<input type="radio" onclick="javascript:Determine('Sport','0');">Sport</input>
					<input type="radio" onclick="javascript:Determine('Blogs','0');">Blogs</input>
					<input type="radio" onclick="javascript:Determine('Forums','0');">Forums</input>
					<input type="radio" onclick="javascript:Determine('Kids','0');">Kids</input>	</td>

 

 

Thanks for the help guys :)

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.