By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Help with mailto: and form results in message body

P: n/a
I don't have access to a server-side solution, so I guess Javascript
is my only choice.

I want to pass a bunch of form fields to an email, but unsure of how
to add the multiple fields into the body section.

What I want to add is the "dropdown" data merged into the body of the
email.
I found this example code (that works just the way I want it to,
except I want to add more data).
My changes are below it:

<script>
function now()
{
var thebody=document.testform.thebody.value;
window.location.href="mailto:so*****@invalid.com?s ubject=Mail
Test&body=" +
escape(thebody);
}
</script>
<form name=testform>
<input type=button value="click me" onclick="now()">
<textarea name=thebody>
This is test email body data.
</textarea>
</form>
----------------------------------
My changes
----------------------------------
<script>
function now()
{
var thebody=document.testform.thebody.value;
var dropdown=document.testform.dropdown.value;
window.location.href="mailto:so*****@invalid.com?s ubject=Mail
Test&body=" +
(thebody)+(dropdown);
}
</script>
<form name=testform>
<input type=button value="click me" onclick="now()">
<textarea name=thebody>
This is test email body data.
</textarea>

<select size="1" name="dropdown">
<option>yes</option>
<option>no</option>
</select></form>
Aug 8 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
G. Morgan wrote:
I don't have access to a server-side solution,
Get one.
so I guess Javascript is my only choice.

I want to pass a bunch of form fields to an email, but unsure of how
to add the multiple fields into the body section. [...]
Client-side scripting is not going to provide an equivalent solution here.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Aug 9 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.