954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can i get href="mailto.. to work in a function.

I have a form that has specific field layouts that does not use

sqlchopper
Newbie Poster
19 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
 

Please use code tags. Please use English, including proper punctuation, spelling, and grammer, as far as possible.

I personally found your message incomprehensible... what does "used the onsubmit and onradiochanged both give errors function not part of form" mean??

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

Please use code tags. Please use English, including proper punctuation, spelling, and grammer, as far as possible.

I personally found your message incomprehensible... what does "used the onsubmit and onradiochanged both give errors function not part of form" mean??

I tried using a "button" and then tried a "radiobutton". sorry, i tend to get wordy and try to keep messages short.

sqlchopper
Newbie Poster
19 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
 

But, what is your actual question? It's lost in run-on sentences and code postings.

Going just from your thread title: you can set the action tag of a form by retrieving the form (the method depends of course on your DOCTYPE), and setting the "action" attribute to a string.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

Sorry, this is wordy.
Let me back up. I have developed a Intra company vendor scheduling web system using ms vb.net. On the scheduling form everything uses absolute positioning.
I've just added two texbox for user to record email addresses. Users want to be able to click on something and have the system pop up a email and prefill it with the email infomation in the textbox. They want three options; Send email using addresses from textbox 1, or from textbox 2, or from both textbox 1 and 2.
PROBLEM 1: I need to anchor the 3 new href links in a absolute position on the screen and develope a function to replace the send to info in the href on the fly based on info in textbox.
I first put a button on the form and used the "onClick" to call the function. That try gave me the error "error smail function not part of web page"
I then tried using a radiobutton and used the "onradiochanged" but got the same error.
So I created a small textbox and use the "onblur" event to kick off the function I posted.
Problem 2: How do I modify the 3 new existing href links with the info from the email textbox areas. It seams after reading tons of stuff on the web that I can not use a javascript function to kick off a email. The function with the "action =" and "submit" works but no email come up and whatever was created goes to nevernever land. I thought of using the Form "onload" event to call the function and I would also have to update the links if info is changed.

sqlchopper
Newbie Poster
19 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
 
sqlchopper
Newbie Poster
19 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
 

This is pretty straight forward and requires just the following javascript code:

window.location = "mailto:email@webaddress.com?subject=email subject&body=Email paragraph text"

hope this helps someone

crunchingnumber
Newbie Poster
1 post since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You