I have a mail form that works correctly in IE but not in netscape. Actually in netscape the form works but will not redirect to the "thank you for inquiry" page. this is what i'm using to redirect.
pform.action="mailto:gino@blah.com";
// put the redirect url in here absolute or relative urls can be used
location.href="thanks.html";
could i put a script on the "Submit" button" to redirect it once it is submitted? Any suggestions would be greatly appreciated!
no, unfortunately that didn't work either. Also, I just found out that the script doesn't work on mac browsers. Does anyone have a crossbrowser javascript for a simple form to submit info to an email address? in the form i have first, last name, address1, address2, city, state, zip, phone email, url , comments.
here is the script.
<script language="JavaScript" type="text/javascript">
<!-- Hide script from older browsers
// This script validates fields, returns error messages, submits form and redirects page
// Ensure that ESSENTIAL FIELDS have been filled in.
function CheckFields(pform) {
// The fields are checked for blanks
if ( pform.FIRSTNAME.value == "" ||
pform.SURNAME.value == "" ||
pform.EMAIL.value == "" ||
pform.ADDRESS.value == "" ||
pform.CITY.value == "" ||
pform.STATE.value == "" ||
pform.POSTCODE.value == "" ||
pform.PHONE.value == "" ) {
alert( "Data in essential fields missing.\nPlease ensure that all fields are filled in." );
return false;
}
alert("'' " + pform.EMAIL.value + " '', is not valid Email Address.");
return false;
}
else {
// If reached this far then thank user, submit form and show redirect page
alert ("'Thank you for your registration submission.'" +pform.FIRSTNAME.value + " '' \nPlease wait a moment while your data is sent to our server")
// put your email address in here
pform.action="mailto:ricky@xtramayo.com";
// put the redirect url in here absolute or relative urls can be used
window.document.location.href ="thanks.html";
thanks but that didn't work either. also, if it is dependant on the users email client does that mean if I'm in netscape I have to use netscape as my email client for the form to work? Could you recommend a place for me to go and find one that isn't ?
Unfortunately, the only way to get around the user's dependency upon their email client is to send an email (and redirect) using server-side scripting.
Basically these services allow you to post your form to a remote server, it then emails the form contents to you, and then redirects to whatever "thankyou" page you have set up on your website.
I would also recommend learning a server-side language of your choice... then you can do pretty much whatever you want!!!
Hope this helps!
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
P.S. JohnKrutsch's solution above would usually work (even though there are still problems relying on the "mailto" action)... he just left out the closing double quote...
setTimeout("window.location='thankyou.htm'",500)
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)