I can't do it in the form action, because I have the mailto link. Simply put, what I did in the if statement, is that okay, there would be no problem with it?

Philip M

12-07-2010, 06:46 PM

You can only redirect after a form submit using server-side scripting. Javascript cannot do that.

The trouble with using mailto: to send form results is its unpredictability. The method it is highly dependent on the browser in use and the email client in use (some people have only Yahoo or Hotmail). In particular, your visitor must have Outlook or Outlook Express as the default client for this to work correctly. Even if your visitor is using Internet Explorer, but the default mail client is different (e.g. Eudora), your mailto form will not work. With all of the browser troubles, you're likely to lose about half of your users' messages. Most of the email clients that can successfully send a mail will prompt the user by a security dialog prior to sending - this can scare many users from continuing. Also, what about people with Javascript disabled?

If you are going to use a form then use a server-side formmail script as the action - there are several good free ones out there.

BTW, when posting here please follow the posting guidelines and wrap your code in CODE tags. This means use the octothorpe or # button on the toolbar. You can (and should) edit your previous post.

Lottery: A tax on people who are bad at math.

mlseim

12-07-2010, 08:28 PM

Who is your webhost, and why can't you use PHP to process the form?

If you can't use PHP (or Perl) ... you can't process the form.

Nexusfactor

12-08-2010, 01:39 AM

I am using my school's server, however, a little Google searching revealed that php and hotmail don't mix. However, this javascript page I was just wondering if it was okay to do the redirect where I did it.