• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Submit to multiple forms at once?

Question

werxDEV    0

Ok, here's the scenario. I have already taken 3 programs, and setup the registration system to insert each bit of username in all three tables for members in the database each one with it's own prefix obviously and I've done this by submitting them all to php page that I have taken the other registration pages apart and put em all three together. Ok so that works fine creating a single user in all three databases.. no problem.

Although I want to make a login form to where I can submit it to each one of these other login submission pages for each unique program. Any idea on how to get a form to submit three times with one click?

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
werxDEV    0

Quick Update: Here's what I'll need, but I'm very very unsure of how to do it.

I'll need to make "two" invisible forms.. (invisible input types)

I'll need some sort of javascript code that will change the variables automatically of these other forms.. does this make sense?

Share this post


Link to post
Share on other sites
  • 0
+mrbester    205

Potentially you could get your server to do it for you using XmlHttp and a POST call, crafted for each different program.

If that isn't an option, then hidden iframes with the forms inside will do it.

Pseudo code:

var form=document.getElementById(iframeID).document.forms[0];

form.inputname.value=whatever;

rinse and repeat

form.submit();

repeat for each form, and THEN submit the original form.

Share this post


Link to post
Share on other sites
  • 0
werxDEV    0

I understand the concept, but I'm not exactly sure if I understand how I would implement it could you show me a coding example?

Share this post


Link to post
Share on other sites
  • 0
werxDEV    0

Bump please.

Share this post


Link to post
Share on other sites
  • 0
+mrbester    205

Which? hidden iframes or server side XMLHttp? I don't have any code samples...

iframes is less hassle to set up:

make a separate page for each registration form. Check that the page in and of itself works.

bung iframes into a master page, each iframe having a src of a particular reg form that you just made.

hide all but the master.

hook into the onsubmit handler for the form to populate the forms in the hidden iframes with any required data, submit those hidden iframe forms and then submit the main form.

Script for accessing across iframes is all over the place. Until you've got everything set up ensure the submission of the main form is always suppressed.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.