/    Sign up×
Community /Pin to ProfileBookmark

Input field values in to email message …

Hi All,

First of all I am newbie with Javascript so terms for describing what I need may be confusing a bit – but hopefully you get it.

I do have a calculator and I would like to add a button in it from where you could send input and calculated values to someone using a default email client (on local machine; opens your email client) so that input and calculated values would be in a email message body.

Example:

Parameter 1 = <input value by user>
Parameter 2 = <input value by user>

Result 3 = <input result value calculated from given values>

Is it possible to do with HTML + Javascript ? I can not have server side scripts.

Thanks in advance,
Tomi

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@FangApr 18.2008 — See: http://www.ssi-developer.net/design/mailto.shtml
&lt;form name="frm" action="#" method="post" enctype="text/plain"&gt;
&lt;p&gt;
Email address:&lt;input type="text" name="email"&gt; Results:&lt;input type="text" name="results"&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;a onclick="this.href='mailto:?to='+frm.email.value+'&amp;amp;subject=Results&amp;amp;body='+frm.results.value;" href="#"&gt;Send&lt;/a&gt;
Copy linkTweet thisAlerts:
@tomikauthorApr 18.2008 — Hi Fang,

Thanks a lot for that =)! That was exactly what I was searching. Only downside of that seems to be that you can add "only" 255 character in to message body ( I wasn't aware about that). Is there any workaround for that 255 character "limitation" ? Is there similar method e.g. to insert values in to a separate *.txt -file and send the *.txt -file as a attachment via email when you have pressed a button ?

Thanks again, Fang !


/Tomi
Copy linkTweet thisAlerts:
@FangApr 18.2008 — Attachments can only be added if you use a server side language.
Copy linkTweet thisAlerts:
@tomikauthorApr 18.2008 — Hi Fang,

OK! Okay, I don't have it ?... Is there any other workaround for that 255 character limitation ?

/Tomi
Copy linkTweet thisAlerts:
@FangApr 18.2008 — The limit is not written in stone; try it out in different email clients.

Thunderbird can send/recieve a lot more.
×

Success!

Help @tomik spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...