Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-09-2006, 02:47 PM   PM User | #1
fechan
New to the CF scene

 
Join Date: Nov 2006
Location: Canada
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
fechan is an unknown quantity at this point
Form image submit button mailto not working

I made an image submit button with rollovers in a form using Javascript. On the href of my submit-image I call a javascript function to submit the form.

Once in the function I can't seem to make the mailto work.

This should work and actually does work when I call the function on the onSubmit of the form instead of the href of the submit-image.
Code:
function doSubmit(form){
form.action = 'mailto:myemail@email.com?subject=ItsNotWorking';
}

(...)

<a href="javascript:doSubmit(TheForm)" onMouseOut  = "switchImage('submitImage',2)" onMouseOver = "switchImage('submitImage',3)" >
<img name="submitImage" src="images/bt_submit.gif" width="67" height="18" border="0"></a>
When I do this instead with the same function it works.
Code:
<FORM NAME="TheForm" ACTION="" METHOD="post" enctype="text/plain" onSubmit="return doSubmit(this)">
I just don't understand why it's not working when I call the function from the image. Any ideas?
fechan is offline   Reply With Quote
Old 11-09-2006, 09:36 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Most browsers either ignore action=mailto or just open the email program and ignore the form. If you want to use mailto: then dump the form. If you want to use the form then dump the mailto and use a server side form2mail script.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:17 AM.


Advertisement
Log in to turn off these ads.