Hello Guyz I have a question for you all hope you guyz will help me out.

Here I have created a form with dynamic values if the user select the radio button of no then a text box echo's here are the code which i created please correct me how will i do this.

<?php
    $yes = "<input type='radio' name='textfield1a' value='Yes' class='chk' />";
    $no  = "<input type='radio' name='textfield1a' value='No' class='chk' />";

    echo $yes . "Yes";
    echo $no  . "No" ;

    if($no==true){
        echo "<input type='text' name='textfield6' class='pw'>". "<br />" ; 
    } 
?>

Please let me know your suggessions

Thank You

try removing the data on 11

Thank you for your kind response but please confirm me whic data are you reffering on line 11 its ?>

i'm not a php developer, but regardless of the server side scripting...if you are processing this server side, you have to figure out what the user selected, correct? well... if the input/radio buttons are within a form, when the user submits the form, you have to collect that data server side.

I helped on a similar thread (instead of radio buttons, it was checkboxes), but the idea of looking at what was posted is the same. see if this thread helps clarify anything for you. There is a link to a working demo as well.

https://www.daniweb.com/web-development/php/threads/468203/checkboxes-passing-form-data-using-html-and-php

hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.