Form Submission

D

degmsb

With Java script when a user hits submit on a form on my site, is it
possible to take the values from the form and submit them to another
form on another Url without the user who submitted the form on my site
knowing?

Essentially ones the user on my site hits submit they would get a thank
you page but on the back end I want to take the values from the form
and submit them to a form on another url on another site

Please help.

Thank you.
 
D

David Dorward

With Java script when a user hits submit on a form on my site, is it
possible to take the values from the form and submit them to another
form on another Url without the user who submitted the form on my site
knowing?

Whenever you say "Do X without the user knowing" then you are probably
trying to do something you shouldn't be.
Essentially ones the user on my site hits submit they would get a thank
you page but on the back end I want to take the values from the form
and submit them to a form on another url on another site

No. You can't get the user's browser to make an HTTP request to another site
without it being obvious to the user (i.e. opening a new window or leaving
your site in the main window).
 
V

VK

With Java script when a user hits submit on a form on my site, is it
possible to take the values from the form and submit them to another
form on another Url without the user who submitted the form on my site
knowing?

Essentially ones the user on my site hits submit they would get a thank
you page but on the back end I want to take the values from the form
and submit them to a form on another url on another site

It is not a JavaScript question, pure HTML:

....
<iframe name="dumpster" src="foobar.html"
width="10" height="10" style="display:none">
....
<form name="frm1" action="toOtherURL" target="dumpster">
....
</form>

To others: this is so well known trick that there is no sense to hide
it. Better show it here rather than let learn it "from the street" :).

One can get a "revenge" when OP will ask to get data back and forth
between body and iframe (this is always the second question :)
 
D

David Dorward

<iframe name="dumpster" src="foobar.html"
width="10" height="10" style="display:none">
...
<form name="frm1" action="toOtherURL" target="dumpster">

Wouldn't work. The user wouldn't get the thank-you page.
 
D

degmsb

David -

My reason for this is that I runs several directories. I want to allow
users to submit at one and also choose to get a submission in the other
directories I run. But I do not want them to see all the back end
processing to submit to the other directories I run I just want to show
them a thank you page and then have the submission happen to the other
directories on the back end.

Any idea on how I can accomplish this?
 
E

Evertjan.

wrote on 26 feb 2006 in comp.lang.javascript:
My reason for this ....

"this"?

Please quote what you are replying to. This is usenet not email.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsreply/>
 
D

David Dorward

My reason for this

Reason for what? http://www.safalra.com/special/googlegroupsreply/
is that I runs several directories. I want to allow users to submit at
one and also choose to get a submission in the other directories I run.
But I do not want them to see all the back end processing to submit to the
other directories I run I just want to show them a thank you page and then
have the submission happen to the other directories on the back end.

Any idea on how I can accomplish this?

Store a list of submissions you have to send to other severs in a database
and then fire them off in batch as a cron job at a later time (perhaps
hourly).
 
V

VK

David said:
Wouldn't work. The user wouldn't get the thank-you page.
I just want to show them a thank you page
and then have the submission happen to the other
directories on the back end.

If I got it right then the "Thank you" message is displayed on the main
page - even before the submission happened. That is a trivia to show
something onsubmit with a minimum of scripting. Of course it is more
robust to have some script running onload in the server response (in
case of submission failure).

In a similar situation with cross-domain account management I simply
used borderless iframes with forms:- CSS'ed on the main page so
visually it was like one page. Plus "status" iframe at the bottom where
all submissions go. The beauty of it what it is mostly functional even
with JavaScript disabled. Of course a control over involved domains is
needed so all forms would have the needed layout and style.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top