Click to See Complete Forum and Search --> : Script for Contact form???
bbruno
04-20-2005, 05:16 PM
Is there any javascripts out there that will submit information (contact form- name, address, phone, etc.) Client would fill this out and submit it. Once submitted, it would be sent to an email address.
Is that possible? I am looking for just something simple. I would love to get a script that will accomplish this without having to use a database and scripts from my web hosting account.
Am I out in left field?
Warren86
04-20-2005, 05:41 PM
<HTML>
<Head>
<Script Language=JavaScript>
function sendMail(isForm){
isBody = "";
recipient = "me@someDomain.com";
isSubject = "Form Data";
isBody = "Name: " + isForm.personal.value +"%0D%0A";
isBody += "Address: " + isForm.address.value +"%0D%0A";
isBody += "City: " + isForm.city.value +"%0D%0A";
isBody += "State: " + isForm.state.value +"%0D%0A";
isBody += "Zip: " + isForm.zip.value;
document.forms.Send.action = "mailto:"+recipient+"?subject="+isSubject+"&body="+isBody+" "
}
</Script>
</Head>
<Body>
<form name='Form1'>
Name <input name='personal' size=25><br>
Address <input name='address' size=30><br>
City <input name='city' size=15> State <input name='state' size=2><br>
Zip Code <input name='zip' size=4><br>
<input type=Reset>
</form>
<form name='Send' action=''>
<input type="submit" value="Send by Email" onclick="sendMail(document.Form1)">
</form>
</Body>
</HTML>
bbruno
04-20-2005, 07:16 PM
Is there any possible way when the client presses the submit button it automatically mails it behind the scenes? So when they push the button, it sends the email to my client.
POSSIBLE?
What you sent is just about what I am looking for. I am going to need to modify it a bit more to have some more fields.
thanks, Ben
Warren86
04-20-2005, 07:30 PM
No, not "behind the scenes." The code does what it does. You asked for something simple. It's just an example. Add fields. Remove fields. It's just an example.
bbruno
04-20-2005, 07:37 PM
Thanks!
bbruno
04-20-2005, 10:53 PM
Any ideas about how to modify the script to keep everything on its own line? This is what happens when i modify the script.
Name:
Address:
City:
State:
Zip: Trial: Trial2:
Warren86
04-21-2005, 04:51 AM
+"%0D%0A";
That starts a new line.
bbruno
04-21-2005, 08:25 AM
I figured it out. It was the nasty little semi colon that was causing me the issue.