• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Submitting two forms at once

Explorer ,
Jun 17, 2006 Jun 17, 2006

Copy link to clipboard

Copied

I'd like to submit two forms with the same submit button. One form posts to a table on my db server. The other form posts to an external server that I don't have asccess to except through the form. Is there a way I can do this?
TOPICS
Advanced techniques

Views

454

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 17, 2006 Jun 17, 2006

Copy link to clipboard

Copied

Try this, not guaranteed.

<FORM NAME="foo1" ACTION="page1.cfm" ... >
<!--- form stuff --->
</FORM>

<FORM NAME="foo2" ACTION="page2.cfm" ... >
<!--- more form stuff --->
<INPUT TYPE="submit " onClick="document.foo1.submit();">
</FORM>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 18, 2006 Jun 18, 2006

Copy link to clipboard

Copied

Thanks for your help.

Here's another challenge...

Is there a way to submit a form automatically without a user having to click on a submit button?

Here's my situation:

I have one form that I collect data in which posts to my database. In the action page for that form I have another form with nothing but hidden fields. The fields of the second form are populated by the values from the first form. The second form posts to a server that I do not have access to. Right now I have a single submit button which the user clicks to submit the data on the second form - is there a way to elimintate this submit button?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 18, 2006 Jun 18, 2006

Copy link to clipboard

Copied

Replace "FORMNAME" with the actual name of your hidden form

<body onload="document.FORMNAME.submit()">

Ken

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

All those solutions require Javascript and therefore can be broken.

Why not use cfhttp in your form's action page to post the data to the remote server? this is the only feasible solution IMHO

Martin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

LATEST
Thanks Ken and Martin. It's always nice to have two solutions to choose from.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation