PDA

View Full Version : Form Posting Etc.. JAVA



LanceKnight
Sep 15th, 2002, 08:11 AM
How can I both have a form submit and redirect to another page on one click of the submit button?

Currently I have the form submiting ( Post via e-mail ) not using CGI...

I know how to do the above tasks individually... but Not as one action....

Thanks

akashik
Sep 15th, 2002, 09:33 AM
possibly not the right answer for you, but is there any reason you're using java for a contact form? As for as a html form, redirects can be done this way:


<form action="path to formmail" method = "POST" name="form name">
<input type=hidden name=recipient value=you@yourdomain.com>
<input type="hidden" name="redirect" value="http://www.yourdomain.com/thanks.html">

It's simple, and it works. :)

*edited to fix a typo*

Greg Moore

LanceKnight
Sep 21st, 2002, 07:39 AM
Still having some problems.. however I believe I'm close...

Within ACTION " path to formail" do I type the url address I want the form sent to?

Within NAME " form Name" is this the html name of my form?

Thanks

akashik
Sep 22nd, 2002, 01:32 PM
The form name can be anything you like. For example if it's a general enquiry form "General Enquiry" would work. Conversely you could use "Support Form" for support etc.

For the path to formmail, it would be best to consult your provider. On a cpanel server you'd just use this:


<form action="../cgi-sys/FormMail.cgi" method = "POST"

The part that sends the form to an e-mail address is this bit:


<input type=hidden name=recipient value=you@yourdomain.com>


Finally, the last bit is a redirection to another page when they hit send, usually a thank you page "Thanks for contacting us" for instance:


<input type="hidden" name="redirect" value="http://www.yourdomain.com/thanks.html">

Greg Moore