Click to See Complete Forum and Search --> : can anyone help me pls thanks!!
yunise
02-28-2003, 05:06 AM
i wanna make a form that after the user fill up it will post (outlook express pop up and already filling the sender address and all the form input "value"will be in the body of message) however, i only can do the sender email automatically filled but the rest i also not sure...... can anyone check my script and pls tell me what wrong n how to create it using easier way. By the way , i just start learn java
<SCRIPT language="JavaScript">
<!--
function e_submit(e_add, e_body)
{
window.location="mailto:"+e_add+"?body="+e_body;
}
//-->
</SCRIPT>
<P>
<FORM name="e_form">
<p>
<INPUT name="emadd" type="hidden" value="123@mmu.edu.my">
<p>
<p>
<p> Name:
<INPUT name="name" type="text" id="name">
</p>
<p> Phone no:
<INPUT name="phone" type="text" id="phone">
</p>
<p> e-mail :
<INPUT name="email" type="text" id="email">
</p>
<P>
<INPUT TYPE="button" Value="submit" onClick="e_submit(this.form.emadd.value,this.form.phone.value)">
Charles
02-28-2003, 05:29 AM
This is strictly an HTML problem. See http://www.w3.org/TR/html4/interact/forms.html.
Dan Drillich
02-28-2003, 08:36 AM
I just tried it and the outlook express new message pops up. In addition to the e-mail address that shows up, the body is the phone number entered in the form.
So, it looks fine to me on IE5.
Most likely, I didn't get you right.
Can you please explain further what you want to happen?
yunise
02-28-2003, 08:42 AM
thank for ur reply,
actually i wanna make all the form infomation go to the body (not just phone no) i want the name n e-mail also include in the body. but i dunno the script ..
Charles
02-28-2003, 08:56 AM
You don't need to use JavaScript here; you just need to use the HTML properly. And if you do use JavaScript then your form will fail for the one in ten users who do not use JavaScript.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<form name="e_form" action="mailto:123@mmu.edu.my">
<p><label for="name">name:</label><br><input name="name" type="text" id="name"></p>
<p><label for="phone">phone no:</label><br><input name="phone" type="text" id="phone"></p>
<p><label for="email">e-mail:</label><br><input name="email" type="text" id="email"></p>
<p><input type="submit"></p>
</form>
Dan Drillich
02-28-2003, 02:23 PM
You can do it like this -
<SCRIPT language="JavaScript">
<!--
function e_submit(e_add)
{
var e_body = document.e_form.name.value+","+document.e_form.phone.value+","+document.e_form.email.value;
window.location="mailto:"+e_add+"?body="+e_body;
}
//-->
</SCRIPT>
<P>
<FORM name="e_form">
<p>
<INPUT name="emadd" type="hidden" value="123@mmu.edu.my">
<p>
<p>
<p> Name:
<INPUT name="name" type="text" id="name">
</p>
<p> Phone no:
<INPUT name="phone" type="text" id="phone">
</p>
<p> e-mail :
<INPUT name="email" type="text" id="email">
</p>
<P>
<INPUT TYPE="button" Value="submit" onClick="e_submit(this.form.emadd.value)">
</FORM>
yunise
02-28-2003, 07:50 PM
yeah it's work!! thankyou so much !!