0

Hi to all,

I am beginner in the field of php & I have a problem as,
I want to show a form , after selection of one of the two radio buttons choices & then click on submit button.

Can i use "onclick()" for this ?
if Yes, please suggest me How ?
if Not , then what should be the right code for this ?

any suggessions will be appreciated.

Thanks & Regards.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by diafol
0

onclick is for javascript (don't bother with this).
You should look for radiobutton values in the $_POST variable that appears in the next page after the form is submitted.

<input type="radio" name="test" value = "first" />My first one
<input type="radio" name="test" value = "second" />My second

The page you specified in the action attribute of your form tag:

<form action="formhandler.php" method="post"> ....

should then have the $_POST['test'] variable.
If you have echo $_POST['test'] somewhere in this page, you'll get 'first' or 'second' appear on the screen, depending which radio button you selected.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.