Closed Thread Icon

Topic awaiting preservation: dual forms submitting (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12370" title="Pages that link to Topic awaiting preservation: dual forms submitting (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: dual forms submitting <span class="small">(Page 1 of 1)</span>\

 
Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-20-2002 00:02

I have one form I want to submit to a php page for processing. I have another form that I want to send to a credit card gateway. Both are in the same document. I only want one submit button. Any ideas?

I don't ever remember having done this or even reading about it before, even though it seems like something basic.

Sometimes I still have to say my alphabet to figure out whether p comes before or after o and where q is in the equation.

Let me know.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-20-2002 00:13

Can't really be done. (kinda)

Theoretically you could spawn a child window and have that submit to one place and the original page can go to a second place but that's not really a good user experience

What you should be doing is have the php page doing both actions, is there some reason you can't?



.:[ Never resist a perfect moment ]:.

Blacknight
Bipolar (III) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 08-20-2002 01:19

why dont you youst use one form sending one part of the form to the db and the others to the credit card gateway??? thats how i would tri it

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-20-2002 02:17

As I think Blacknight [edit: and bitdamaged ] was getting at - couldn't you just have a page which collects all the goodies from the form then process one part and then do the credit card processing after that?

___________________
Emps

FAQs: Emperor

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-20-2002 03:13

Hey I said that too

Maybe to help things out I know when I was developing a commerce site I had a similar issue, the site was developed in PHP but I had to use a perl script for my credit card processing. What I did was use an exec command to call the perl script and process the results



.:[ Never resist a perfect moment ]:.

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-21-2002 18:18

I dunno. I have my action for the form going to the confirmation page. I don't know how I would send the appropriate form info to the gateway and then run the confirmation page. I've never had to do that before.

I think the problem I am having is imagining how I would get the information to submit to the gateway without actually putting the gateway page in the action attribute for the form tag. Is there a way to do that?

Maybe I could pass the variables to a page that has hidden fields and doesn't do anything except blink for a second before using a header to redirect them to the appropriate page. Is there a way to say onLoad submit form?

I hate to have to change how I have things set up because it has to be done tomorrow night and if I have to work late on my anniversary, my wife is going to KILL me.

Help a poor married fellow out.

Blacknight
Bipolar (III) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 08-21-2002 19:26

ok you have 1 form ...submit sends you to the confermation page.......on this page the date gets sent to the db ....clear so far
the rest of the data has to be sent to the gateway .......hmmmm......thats hard beacause i dont quite know how the sending to the gateway workes....but it should be possible to do the saving to the db on the same page as the sending to the gateway

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 08-21-2002 19:42

The standard operating procedures that Authorize.net passes is to create form fields with certain names. The fields with the appropriate names are sent to the server in the action attribute to the specific url required by Authorize.net. What I lack is the knowledge on how to do what it is you're saying... being able to send the info to the gateway on the same page as the DB update.
Actually, it's a little more complicated than just a DB update, which is why I don't just have the DB update on the same page as the 'order complete' page. Normally I would just send hidden values and then have the mysql update automatically on the next page, and the action would be the gateway server url. I don't think that would even work, though.
Completely stumped.
Wait... check this, tell me if it would work. submit button goes to the checkform function. in the checkform function, if there are no errors, redirect to this page, which is the process page before the 'order complete' page. That may free up my action attribute so that I can place the gateway there. Sounds a little farfetched to me. Would the form info still pass to the processing page?
This seemed so simple when I started.

« BackwardsOnwards »

Show Forum Drop Down Menu