[Javascript] Mail from Javascript Not Working

Roger Roelofs rer at datacompusa.com
Mon Dec 27 22:51:12 CST 2004


Peter,

On Dec 27, 2004, at 2:33 PM, Peter Gibson wrote:

> I have a page at http://www.meantrader.com/Trial.htm that I use to 
> accept
> trial subscribers to a service I run.
>
> I have Javascript on page that validates that user has supplied an 
> e-mail
>  address and confirms user has accepted the terms and conditions for 
> the service.  Works
> fine on our computers.  Receiving complaints from users attempting to 
> sign
> up that nothing happens when they attempt to sign up.
>
> What I have programmed on the form is:
>
> <FORM NAME ="form1" action="mailto:Trial at MEANtrader.com" METHOD="post"
>  onsubmit="validate();"
>
> So I'm expected the user to see an e-mail sent with the Trial 
> subscription
>  information.
>
> Appreciate any ideas on what problem might be going on and best way to 
> test for this
>  kind of thing.  Thanks.

Form submissions via mailto: links are inherently unreliable.  Many 
people don't have their email client set up to respond to mailto links, 
so nothing happens when the submit button is pressed.  I'd bet that 
your isp has a form to email processor that you could hook in fairly 
easily.

A number of your image links don't work because they are pointed at 
files on your local hard drive.  Look for things like this 
"file:///C|/inetpub/wwwroot/HT/images/col_tile.jpg" and change them to 
"images/col_tile.jpg".

The validate function is in a script block without a type attribute.  
This makes the browser guess at what the language might be.  Bad things 
happen when browsers have to guess... they don't often guess alike.

The validate function is supposed to return false to stop the form from 
being submitted, but doesn't return anything, so, even if there are 
errors, it still submits the form.

Also, your css is not likely to work well because there are several 
errors in the html.  I'd suggest submitting your page to the validator 
<http://validator.w3.org> to help find the errors and remove them.

hth,
Roger,

Roger Roelofs
Know what you value.



More information about the Javascript mailing list