Link to home
Start Free TrialLog in
Avatar of edmac
edmac

asked on

Can forms be nested on a page?

I have a web page with multiple forms. I would like to email the complete page when it is finished.. Can the forms be nested within a form to submit the email?
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

No.

You can have more than one form on the page but they cannot be nested.  The solution is
put hidden fields on the first form.  When the second form is completed the fields get moved
to the hidden forms on the first form and are submitted with it.

Cd&
Avatar of webwoman
webwoman

And define 'email the complete page'

It's better NOT to try to create an HTML email. It's much easier to create a neatly formatted regular email that everybody can read, and add a link to a web page if you feel it necessary.

If what you're generating is an order, or an order confirmation, HTML formatting really isn't necessary anyway.
Avatar of edmac

ASKER

How are the hidden fields updated from the other forms?
updating the hidden fields ?
you can do it in many ways
say you have a text txt1 whose value is to be copied to a hidden field hid1
for this you can use event like onchange of the text , so every time the text changes , the new change is copied to the corresponding hidden field
eg.
write this on the onchange event of the text field txt1
window.document.all.hid1.value = window.document.all.txt1.value

or if you have a submit button then
on the onsubmit event you can write such multiple value assignments to copy the values of more then one HTML controls/fields to their corresponding hidden fields

ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad I could help. Thanks for the A. :^)

Cd&