ok im trying to make a form for my website but its not really working.
This is my script so far.
Code:
Your Name Here
Your E-mail Here
Subject
Comments Or Questions
if someone could help me thanks[/code]
help making a form
-
- Posts: 20
- Joined: Sun Dec 26, 2004 2:20 pm
Here's an Excellent HTML Tutorial - has forms, tables, blah blah - and is very systematic and you build a full web site from learning in the process..
http://www.mcli.dist.maricopa.edu/tut/ - its downloadable too..
Hope this helps.. Cheers
http://www.mcli.dist.maricopa.edu/tut/ - its downloadable too..
Hope this helps.. Cheers
form code with javascript validation
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!-- start of script
function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
function emailvalidation(entered, alertbox)
{
with (entered)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}
function formvalidation(thisform)
{
with (thisform)
{
if (emptyvalidation(first,"Enter your First name")==false) {first.focus(); return false;};
if (emptyvalidation(last,"Enter your Last name")==false) {last.focus(); return false;};
if (emailvalidation(email,"Enter Valid Email")==false) {email.focus(); return false;};
if (emptyvalidation(textarea,"Enter your comment")==false) {textarea.focus(); return false;};
}
}
// end of script-->
</script>
</head>
<body>
<form action="mailto:yourE-mailAddress@domain.com?subject=yourChoice" method="post" enctype="text/plain" name="contact" class="center" id="contact" onSubmit="return formvalidation(this)">
First Name:
<input name="first" type="text" size="25" maxlength="40" />
Last Name:
<input name="last" type="text" size="25" maxlength="50" />
</p>
Your E-mail:
<input name="email" type="text" size="20" maxlength="50" onChange="emailvalidation(this,'Invalid E-mail');" />
</p>
Subject:
<select name="select">
<option>Advice</option>
<option>Comment</option>
<option>Other</option>
</select>
</p>
<textarea name="textarea" cols="50" rows="4">Write Your Comments here...</textarea>
</p>
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="reset" value="reset" />
</p>
</form>
</body>
</html>
I hope this helps
<html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!-- start of script
function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
function emailvalidation(entered, alertbox)
{
with (entered)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}
function formvalidation(thisform)
{
with (thisform)
{
if (emptyvalidation(first,"Enter your First name")==false) {first.focus(); return false;};
if (emptyvalidation(last,"Enter your Last name")==false) {last.focus(); return false;};
if (emailvalidation(email,"Enter Valid Email")==false) {email.focus(); return false;};
if (emptyvalidation(textarea,"Enter your comment")==false) {textarea.focus(); return false;};
}
}
// end of script-->
</script>
</head>
<body>
<form action="mailto:yourE-mailAddress@domain.com?subject=yourChoice" method="post" enctype="text/plain" name="contact" class="center" id="contact" onSubmit="return formvalidation(this)">
First Name:
<input name="first" type="text" size="25" maxlength="40" />
Last Name:
<input name="last" type="text" size="25" maxlength="50" />
</p>
Your E-mail:
<input name="email" type="text" size="20" maxlength="50" onChange="emailvalidation(this,'Invalid E-mail');" />
</p>
Subject:
<select name="select">
<option>Advice</option>
<option>Comment</option>
<option>Other</option>
</select>
</p>
<textarea name="textarea" cols="50" rows="4">Write Your Comments here...</textarea>
</p>
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="reset" value="reset" />
</p>
</form>
</body>
</html>
I hope this helps
few more things to tell
note: i've wrote
You have to put your email address there where u want the form to be forwarded (i've used email forward system but u can just change it) and i put a subject on it .. you put anything of your choice which will be ur email subject.
one more thing on the form i also added
but the easiest way to make a form look good is by using tables. if you have dreamweaver you can make forms without much knowledge of html. i hope it helps.
<body>
<form action="mailto:yourE-mailAddress@domain.com?subject=yourChoice"
You have to put your email address there where u want the form to be forwarded (i've used email forward system but u can just change it) and i put a subject on it .. you put anything of your choice which will be ur email subject.
one more thing on the form i also added
you can always change it..
Subject:
<select name="select">
<option>Advice</option>
<option>Comment</option>
<option>Other</option>
</select>
but the easiest way to make a form look good is by using tables. if you have dreamweaver you can make forms without much knowledge of html. i hope it helps.
thanks! :lol:Challenged wrote:Here's an Excellent HTML Tutorial - has forms, tables, blah blah - and is very systematic and you build a full web site from learning in the process..
http://www.mcli.dist.maricopa.edu/tut/ - its downloadable too..
Hope this helps.. Cheers
bookmark this site.
That website helped me to make a form for my fantasy website, an application form! Well done cnnn!cnnn wrote:thanks! :lol:Challenged wrote:Here's an Excellent HTML Tutorial - has forms, tables, blah blah - and is very systematic and you build a full web site from learning in the process..
http://www.mcli.dist.maricopa.edu/tut/ - its downloadable too..
Hope this helps.. Cheers
bookmark this site.
-
- Posts: 243
- Joined: Mon Feb 28, 2005 4:34 am
- Contact: