Click to See Complete Forum and Search --> : hidden fields not passing data in forms


Thanatos
12-01-2002, 05:56 PM
Page A:
<FORM method = "POST" action="do_showfielddef.php">
<P>Table Name:<br><INPUT type="text" name="table_name" size=30></P>
<P>Number of Fields:<br><INPUT type="text" name="num_fields" size=5></P>
<INPUT type="submit" value="Go to step 2">
</FORM>



using on Page B:
<input type="hidden" name="table_name" value="<?php echo "$table_name"; ?>">

where $tablename in the page proves that it has a value on this page (it is displayed when the page loads)




the following line shows that it has no data on Page C:

<h1>Adding table <?php echo "$table_name"; ?> </h1>

Am I missing something? all the other values are passed in the form.... Does it matter that the initial value for $table_name is passed from Page A?

Thanks....

Thanatos
12-01-2002, 05:58 PM
Also: I remember having this problem in perl, and instead of passing the tag as hidden, I put it as a one-option dropdown box, which allowed it to pass through to the next page??? I'm using apache 1.3.26....

Thanatos
12-01-2002, 07:23 PM
Okay, If I pass the data to two hidden fields, like so:

<INPUT TYPE="hidden" NAME="table_name" VALUE="<?php echo "$table_name"; ?>">

<INPUT TYPE="hidden" NAME="table_name" VALUE="<?php echo "$table_name"; ?>">

it works. Now don't mind the NAME="table_name" twice--you can change the name from table_name to poop, and it will still work--as long as the name you WANT the data in is the second one. Am I the only one with this problem?? It doesn't make sense.... Now I have to hack my sql code some more to figure out why THAT portion won't work. Another day, another stumbling block...