G
G. Morgan
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:[email protected]?subject=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:[email protected]?subject=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>
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:[email protected]?subject=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:[email protected]?subject=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>