Jump to content
xisto Community
Sign in to follow this  
darran

Submit Multiple Forms At Once

Recommended Posts

Is there a way I can submit multiple forms at once? For e.g. I click on a dropdownlist to generate 6 forms (I have done this) using Javascript, but I am not sure how I can define each form with a name and their action.Is it possible to do this and if so, can you enlighten me further?

Share this post


Link to post
Share on other sites

Without looking anything up, I would say this is not possible. Each Form has an action attached to it. If you could send control to 6 different places, and they can set a process in action, where does it stop? So plan on having the form submit only once to a page which validates and performs all the tasks you want done by the six forms, but from a single script, possible looping to get everything done? That'd be my take on it.

Share this post


Link to post
Share on other sites

I think its possible with this teknik.. assuming that I get wat u mean... :P

You can manually send data to the form processor/page.

http://
https://www.icloud.com/
https://www.icloud.com/
https://www.icloud.com/

With one click on the dropdouwn list you can make a javascript that will open this addresses with the data attached to the URL.
Edited by saga (see edit history)

Share this post


Link to post
Share on other sites

I am sorry if I have confused you with my title. What I meant was to create multiple form elements for submission using javascript. I have already achieved it, adding elements in a form dynamically, and with their own unique IDs by means of a for loop and a variable. Is it possible to have access to these 'javascript added' elements? Can they function like normal form ids placed in the body tags?

Share this post


Link to post
Share on other sites

i think i understand, im not very good with JS but i think theres a way that goes something like "formname.submit()" and if you were to put that function into an OnClick event on the button eg:

<button OnClick="form1.submit(); form2.submit();">Submit</button>

then it should submit all the forms at once, again ill say im not very good with JS but you can try googling the form.submit function and see what you find.

Share this post


Link to post
Share on other sites

Is there a way to validate dynamically created fields using javascript?I tried using a for loop but the problem is these dynamically created fields are not under the form tag. Because I am using the innerHTML of a div tag to create these fields. How can I validate them?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.