Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About Forms and Post 1

Status
Not open for further replies.

NVSbe

Programmer
Joined
Sep 9, 2002
Messages
153
Location
BE
I'm rather new, and very confused about php.. I'm reading up though, and I like to think I'm slowly getting better... I have a problem which is puzzling me, though...

I have nested forms set up like this

<FORM ACTION = &quot;result.php&quot; METHOD = &quot;POST&quot;>
<FORM NAME = &quot;f1&quot;>
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;1&quot; NAME=&quot;A1&quot;> x
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;2&quot; NAME=&quot;A2&quot;> y
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;3&quot; NAME=&quot;A3&quot;> z
</FORM>

<FORM NAME = &quot;f2&quot;>
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;1&quot; NAME=&quot;A1&quot;> x
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;2&quot; NAME=&quot;A2&quot;> y
<INPUT TYPE = &quot;RADIO&quot; VALUE=&quot;3&quot; NAME=&quot;A3&quot;> z
</FORM>

<INPUT TYPE=&quot;SUBMIT&quot;>
</FORM>

The radiobuttons are being filled with data from a database, and for each record in the table, a subform is made... The question is, in result.php, which variables are in the array? Is there a way to check?

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Code:
echo &quot;<pre>&quot;;
print_r($_POST);

enjoy

-Rob
 
Thanks... the results were.. interesting, though not what I expected. Appearantly, the array is empty, unless A1 from f1 is checked, in that case it has A1=1 in it.. Does this make sense?

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
I removed the nested forms, and put all the radiobuttons in one form... this seems to work better...

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Yeah, I'm no expert on forms, but I wasn't even aware you could nest forms like that... in fact when I tried to cut'n'paste your code my submit button didn't work (using the firebird browser). In other words, I have no idea what makes sense and what doesn't for what's actually in the array.

g'luck

-Rob
 
I do not believe that forms can be nested - at least it is not mentioned in the W3C specification for HTML4.
It would also make no sense to nest forms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top