Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form Validation,redirect 1

Status
Not open for further replies.

dashusa

Programmer
Mar 27, 2006
46
US
Hello
I have a form that sends an email once it has been filled in.My question is how do i redirect the form page back to the home page onnce the user has clicked on the submit button.
At the moment when the user hits the submit buttonnn it fires a form validation function...
Thnks in Advance
David
 
1) how are you validating the data (is your validation function written in javascript or server-side code?)
2) how are you sending the email?

after the email is sent, assuming you are using server-side code for this, you can use a typical redirect call to send the user back to the home page.



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Hey Thanks for the fast reply..
I am validating the data by javascript

<input type="submit" onSubmit="return checkData()" value="Send Request"/>

so where do i put the redirect? i tried to put a response.redirect line at the bottom of the form validation code but it didnt work ..
Thanks again
David
 
again, how are you sending the email?

the javascript code for "redirecting" is:

Code:
window.location = '[URL unfurl="true"]http://www.mypage.com/';[/URL]



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Ahhh i was using jscript???
im using mailto:da@shsh.com
in the form action part...
Is this the best way to do it?
 
If you don't have access to server-side scripting engines (PHP, ASP, ColdFusion, CGI, etc.), then that is pretty much the only way to do what you want.

If you do have access to server-side scripting, check out the related forum.

If you don't, then I don't think you'll cleanly be able to send an email using the mailto: action and redirect back to the home page.



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top