Jump to content

Get value of Radio button


houssam_ballout

Recommended Posts

Here;

 

<td><input type="radio" name="RadioPrice1" /></td>

<td>Dis 1</td>

<td><input type="text" name="Dis1" /></td>

<td><input type="radio" name="RadioPrice1" /></td>

<td>Disc 2</td>

<td><input type="text" name="Dis2" /></td>

 

If the first radio checked, then the Dis1 box will be taken into consideration

if the second radio had been checked, then the Dis2 box will be taken into consideration

 

Thanks

<td><input type="radio" name="RadioPrice1" value="1" /></td>
<td>Dis 1</td>
<td><input type="text" name="Dis1" /></td>
<td><input type="radio" name="RadioPrice1" value="2" /></td>
<td>Disc 2</td>
<td><input type="text" name="Dis2" /></td>

and the php:

<?php 
if($_POST['RadioPrice1'] == 1){
//deal with Dis1
} else {
//deal with Dis2
};
?>

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.