wordpress_add

Tuesday 12 November 2013

How to get the value of radio button.!!!

Dr-Wordpress : through Php How to get the value of radio button...!!!

<form name="my form" method="POST" action="validate.php"> 
<label >
  <input type="radio" id="id_radio1" name="name_radio" value="1"/>Dr-wordpress 1</label>
<label>
    <input type="radio" id="id_radio2" name="name_radio" value="2"/>Dr-wordpress 2</label>
<label>
     <input type="radio" id="id_radio3" name="name_radio" value="3"/>Dr-wordpress 3</label>

<input type="submit">

</form>

NOTE : Must gave the value in input tag other wise just ON/OFF will display 

<?php

if(isset($_POST['submit']))

{
    echo $radio_value1 = $_POST["name_radio"];
}
?>


Subscribe Dr-Wordpress for Important Knowledge of wordpress..your's suggestions are most welcomed.

No comments:

Post a Comment