Click to See Complete Forum and Search --> : Form
prune316
01-04-2003, 04:30 PM
I was wondering if anyone knows how to put the value of the textbox in the following:
<a href="mailto:prune_3_16@hotmail.com?Subject=Brochure&Body=Please send me your brochure.[value of textbox]"
Thanks
Brian Peebles
Ummm... Why not use a form handler?
khalidali63
01-04-2003, 06:33 PM
will something like thi swork for u?
<script>
function processForm(){
var subject = document.frm.subject.value;
var body = document.frm.body.value;
document.frm.action="mailto:k_ali@shaw.ca?subject\="+subject+"&body="+body+";";
document.frm.submit();
}
</script>
</head>
<body>
<form name="frm">
Subject :<input type="text" name="subject"><br>
Body :<input type="text" name="body"><br>
<input type="Button" value="Process" onclick="processForm();"></input>
</form>
prune316
01-04-2003, 06:37 PM
I hope
Brian Peebles
prune316
01-04-2003, 06:41 PM
Yes this does work
Thank you
Originally posted by khalidali63
will something like thi swork for u? Sure, it will, but it is a form handler. Why not just put the action of your form to this, if submitting a form is an option...
<form action="mailto:you@yourname.com">:confused:
prune316
01-05-2003, 12:53 PM
Now I'd like to include some text inside the body of the email
&body=[insert text here]"+email+";
Brian Peebles
khalidali63
01-05-2003, 12:57 PM
Take alook at the last part of this code from my last post for u.
document.frm.action="mailto:k_ali@shaw.ca?subject\="+subject+"&body="+body+";";
Anything you want to put in body put it in a var body="your message"
and the it should work fine for u.
"&body="+body
Khalid
prune316
01-05-2003, 01:02 PM
like this:
document.frm.action="mailto:k_ali@shaw.ca?subject\="+subject+"&body=your message"+body+";";
Brian
khalidali63
01-05-2003, 01:24 PM
"&body=your message"+body+";";
not like that
"&body="+body+";";
the word body is a variable that holds the data that u want to send in the email.
prune316
01-05-2003, 01:27 PM
It Doesn't work
prune316
01-05-2003, 02:04 PM
Two things
Is it possible to use radio buttons to put stuff into the body of the email.
and
Could the radio button value and the textbox value be inserted into the body.
B
khalidali63
01-05-2003, 02:24 PM
you must be doing something wrong..:-)
u can put any value in a variable and set that value to body of the email.
just get the values u want to add to body.
prune316
01-05-2003, 02:32 PM
ok thanks
Zach Elfers
01-05-2003, 02:34 PM
No, you must watch for double quote marks ("). If you want quote marks in the body text, prefix them with "\". Also, you must declare what will be in the body BEFORE you write &body=" + body + ";
Like this:
var body = "\"Hello!\". This is the body.";
document.frm.action="mailto:k_ali@shaw.ca?subject=" + subject + "&body=" + body;
That should work.
To do this with radio buttons:
<input type="radio" name="radio1">
<input type="radio" name="radio2">
Then:
if (radio1.checked == true)
var body = "body";
if (radio2.checked == true)
var body = "body";
else
var body = "body";
jeffmott
01-05-2003, 03:32 PM
Zach Elfers
No, you must watch for double quote marks (")
Where are the double quotes unmatched? They look fine to me.
Zach Elfers
Also, you must declare what will be in the body BEFORE you write &body=" + body + ";
...they did
How do you ever manage to come up with solutions to problems that don't exist?
prune316
01-05-2003, 04:39 PM
I've made a few adjustments and I have the this on the end of the email address:
fear@rwe.com?radio1=on
How can I get rid of the radio1=on?
B