Reply
Email Form/Html
Old 04-26-2008, 04:32 PM Email Form/Html
Banned

Posts: 143
Name: Blake
Location: Cuyahoga falls,Ohio
Ok ive been wanting to do this. And today out of the Blue i looked for it and i found something that i could work with it's a Email form Using Javascript. You see the thing is im to lazy to install php On my server. so i need something to get around Downloading Php on to my server. I found a email form With javascript. Were it says begin and end script do i put that in my <head> tags? Im Trying to Put this on my website where it say's Email List.http://www.blakeanthonydesign.com


Code:
 
<html>
<head><script LANGUAGE="JavaScript">
<!-- This script and many more are available online from -->
<!-- The JavaScript Source!! http://javascriptsource.com -->
<!-- Begin
function getCookie(name){
var cname = name + "="; 
var dc = document.cookie; 
if (dc.length > 0) { 
begin = dc.indexOf(cname); 
if (begin != -1) { 
begin += cname.length; 
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
} 
}
return null;
}
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + 
((expires != null) ? "; expires=" + expires.toGMTString() : "")
+ "; path=/";
}
function setName() {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var prompt=i = document.Mail.name.value;
setCookie("name", i, expdate);
}
function getName() {
if(getCookie("name") != null) {
document.Mail.Name.value = getCookie("emailname");
}
}
function getInfo() {
var now= new Date();
document.Mail.Info.value = "Browser: " + navigator.userAgent;
document.Mail.Info.value += "Date:" + now;
}
function checkMultiple() {
if (getCookie("emailsent") == 'true') return true;
else return false;
}
function process() {
setCookie("emailsent", "true");
with (document.Mail) {
if (Subject.selectedIndex == 1) action = "mailto:antispammer@earthling.net?subject=TJS - Comment";
else if (Subject.selectedIndex == 2) action = "mailto:antispammer@earthling.net?subject=TJS - Question";
else if (Subject.selectedIndex == 3) action = "mailto:antispammer@earthling.net?subject=TJS - Suggestion";
else if (Subject.selectedIndex == 4) action = "mailto:antispammer@earthling.net?subject=TJS - Broken Link";
else action = "mailto:antispammer@earthling.net?subject=TJS - Other";
}
}
function formCheck() {
var passed = false;
with (document.Mail) {
if (Subject.selectedIndex == 0) { 
alert("Please pick a subject.");
Subject.focus();
}
else if (Name.value == "") {
alert("Please inlcude your name.");
Name.focus();
}
else if (checkMultiple()) {
if (confirm("You just sent an e-mail from this form, are you sure you want to send another?")) {
process();
passed = true;
}
}
else {
process();
passed = true;
}
}
return passed;
}
// End -->
</script>
<title>JavaFILE</title>
<base target="leftframe">
</head>
<body BGCOLOR="#ffffff" link="#CC0033" vlink="#333399" alink="#FF0000" <!--content start-->
<p align="center"><img src="http://www.javafile.com/images/banner.GIF"
alt="banner.GIF (2826 bytes)"></p>
 
<table WIDTH="96%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<tr>
<td WIDTH="100%">Without question, this is the best javascript email form I have ever
seen. It sets cookies, checks form completion of all fields, and even knows if someone has
already sent a message with the form...JavaFILE gives this one 4936.7 stars! :)<font
FACE="ARIEL,HELVETICA" SIZE="-1"><p align="center"></font>Author: <a
href="
blktallos is offline
Reply With Quote
View Public Profile Visit blktallos's homepage!
 
When You Register, These Ads Go Away!
Old 05-02-2008, 03:39 AM Re: Email Form/Html
Average Talker

Posts: 15
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);
return false;
}
else {return true}
}
} function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false;}
}
}
</script>
</head> <body>
<form action="submitpage.htm"
onsubmit="return validate_form(this)"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit">
</form>
</body> </html>
__________________
Web Site Development

Free Templates
gazal is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 10:37 PM Re: Email Form/Html
Experienced Talker

Posts: 33
Name: Shawn Lindsey
Well usually with all Email Form, it is done using a simple PHP script, you don't have to install a PHP program on your site, just a php handler, that will handle the POST action of your form that you are emailing. THere are many free email php scripts out there all you have to do is upload it to your server, specify in it where you watn the email to go, and then tell your HTML form to use that php script as its POST action.
__________________
http://www.shawnsitsolutions.com Web and Graphic Design, Wordpress, XHTML/CSS, Ecommerce and more.
http://www.discountestore.com Discount Electronics, Computer Parts, and More.
ShawnITSolution is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 11:13 PM Re: Email Form/Html
Banned

Posts: 143
Name: Blake
Location: Cuyahoga falls,Ohio
Thank you All for your Great replies
blktallos is offline
Reply With Quote
View Public Profile Visit blktallos's homepage!
 
Old 05-04-2008, 09:38 PM Re: Email Form/Html
Banned

Posts: 16
very good.I often use asp code for web email .but it is need server support asp.
now javascript needn't again.it is helpful to me,too.
very thanks.
bbmm1980 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Email Form/Html
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12776 seconds with 12 queries