Hi,
How to pass the value of course in form1 to item_name in form f2 as a php variable?
<form action="" name="f1">
<input type="radio" align="middle" name="course" value="A">
<input type="radio" align="middle" name="course" value="B">
<input type="radio" align="middle" name="course" value="C">
</form>
<form action="" name="f2">
<input type="hidden" name="item_name" value=<?php $value?> />
</form>
Please help
Regards,
Sobha
Passing html value to a phpvariable in same page
Moderator: General Moderators
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: Passing html value to a phpvariable in same page
I think that you want the value of "item_name" to be A, B or C, depending on which radio button is clicked. Is this right? You can't use normal php/html to pass this value if forms f1 and f2 are on the same web page. You could use JavaScript, however. But I wonder if you would not do best to rethink the programme logic so that the server takes the value from "course" and then uses it in for whatever purpose you need.
-
shafiq2626
- Forum Commoner
- Posts: 88
- Joined: Wed Mar 04, 2009 1:54 am
- Location: Lahore
- Contact:
Re: Passing html value to a phpvariable in same page
[quote="sobha"]Hi,
How to pass the value of course in form1 to item_name in form f2 as a php variable?
<form action="" name="f1">
<input type="radio" align="middle" name="course" value="A">
<input type="radio" align="middle" name="course" value="B">
<input type="radio" align="middle" name="course" value="C">
</form>
<form action="" name="f2">
<input type="hidden" name="item_name" value=<?php $value?> />
</form>
helow
you should have to submit first form and then this can be pass value to second form like this
<form action="" name="f2">
<input type="hidden" name="item_name" value=<?php echo $_POST['course'];?> />
</form>
How to pass the value of course in form1 to item_name in form f2 as a php variable?
<form action="" name="f1">
<input type="radio" align="middle" name="course" value="A">
<input type="radio" align="middle" name="course" value="B">
<input type="radio" align="middle" name="course" value="C">
</form>
<form action="" name="f2">
<input type="hidden" name="item_name" value=<?php $value?> />
</form>
helow
you should have to submit first form and then this can be pass value to second form like this
<form action="" name="f2">
<input type="hidden" name="item_name" value=<?php echo $_POST['course'];?> />
</form>