Jump to content

[SOLVED] Nested Forms....


Alexhoward

Recommended Posts

Are you sure you mean "nested" forms where one form is inside another form? If you mean separate forms (as genericnumber1 suggests, then you just need separate forms). But, I have never heard of nested forms.

 

I did a quick test where a form was inside another form. I suppose you are expecting if the inner form is submitted that only the inner form data is sent. Whereas if the outer form is submitted then both forms' data is sent. But, my tests showed that all the data from both forms is always sent and in some cases some fields were not sent based upon the layout of the two forms.

 

Not sure what you are trying to accomplish here. More details please.

Link to comment
Share on other sites

Hi Guys,

 

I didn't think it was possible....

 

Yes i mean "nested" (a form within a form)

 

The reason being that i have a booking form with a discount code input.

 

i wanted to be able to submit the discount code (if entered) and if it exsists to discount the total.

 

Then the final submit to send all the infomation to MySQL...

 

I just didn't want to use javascript, but i guess i should...

 

Thanks for your help

Link to comment
Share on other sites

what you want : to submit the discount code only if one is submitted

 

what you need to do : check if user submitted a discount code on the next page, then do a simple

 

$discountcode = clean_data/trim/whatever($_REQUEST['discountcode']);

if its not empty, submit to database

 

Link to comment
Share on other sites

Thanks for all our replies,

 

However,

 

as both buttons submit the entire form, but only submit the button name pressed,

 

I will run one querie is one button is pressed and another if teh other is pressed,

 

saving all teh inputs into sessions, and displaying them again in teh form if they are set.

 

This will work, as a work around, and that'll do

 

Thanks for your help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.