Posted by Jerry Stuckle on 02/22/07 19:39
elia wrote:
> Hello. Yes, already ask but no answers for this little problem.
> I've got a form and 3 steps or page for the same form. If we come back
> to the first page, the states of button radio are lost.
>
> First page (form1.php)
> <?
> $gender=$_POST['gender'];
> if(isset($_POST['gender'])){
> $statusm="";
> $statusf="";
> if($_POST['gender']=="M"){$statusm="checked"}
> else{$statusf="checked"}
> ?>
>
> <Form... action="form2.php">
> ...
> <input name="gender" type="radio" id="male" value="M"<?php echo
> $statusm
> ?>> M
> <input name="gender" type="radio" id="female" value="F"<?php echo
> $statusf ?>>F
> ...
> </Form>
>
> Second page (form2.php)
> <?
> $Gender=$_POST['gender'];
> ?>
>
> <Form... action="form1.php">
> ...
> <input name="gender" type="hidden" id="gender" value="<? echo $gender ?
>> " />
> ...
> </Form>
>
> But it doesn't work!!!
>
> A solution could be with "session_start()" and $_cookie but I don't
> know how to do it!
>
> If anybody could write me all I need on the two pages with a little
> exemple?? (The same problem come with the checkox or choise with
> dynamic menu!) Thanks, pascal
>
Look at your source code. I think you'll find this comes out to
<input name="gender" type="radio" id="male" value="M"CHECKED> M
Note the lack of a space between "M" and CHECKED.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|