Click to See Complete Forum and Search --> : Mailing a form...


dawgbone
02-17-2003, 11:07 PM
I am trying to figure out how to email a form, and have a new page open up as well...

I can do one or the other, but I can't do both.

LAwebTek
02-17-2003, 11:14 PM
do you want to open the new page in a new window or the same? Please post some code so I know how your trying to do this.

dawgbone
02-17-2003, 11:19 PM
<form method='post' action="mailto:bramptonseniorfield@hotmail.com" name='form1' onsubmit="return validate(this)" enctype='text/plain'>

<br>First Name: <input name='firstname' size='30' maxlength='30'><font color='red'>*</font>
<br>Last Name: <input name='lastname' size='30' maxlength='30'><font color='red'>*</font>
<br>Street Adress: <input name='address' size='30' maxlength='50'><font color='red'>*</font>
<br>Postal Code: <input name='postal' size='20' maxlength='6'><font color='red'>*</font>
<br>Phone Number: <input name='phone' size='20' maxlength='10'><font color='red'>*</font>
<br>Email Address: <input name='email' size='30' maxlength='40'><font color='red'>*</font>
<br><br>
Leave a comment or suggestion:
<br><textarea cols='50' rows='3' name='comments'></textarea>
<br><br>
<input type='submit' value='SEND'>
<input type='reset' value='CLEAR'>
</body>

That is it, ignoring my 300 lines of validation. I would like after the submit button is pressed for it to go to a new page (in the same window)... like I said, I can either email, or have a new page load, but not both.

LAwebTek
02-18-2003, 12:10 AM
<input type='button' value='SEND' onClick='javascript:document.form1.submit();document.location.href="http://www.lawebtek.com"'>

I suggest looking up free remotely hosted cgi for your form to mail (action). Using the (action="mailto:bramptonseniorfield@hotmail.com") method requires a security check and if your browser is set up like mine, a new window to send the forms contents as email. The above code will work either way though.

dawgbone
02-18-2003, 12:23 AM
Thanks...

Heck, I would rather do it in PHP, but I am only doing what is asked of me.