With the help of some good people from this community I've (or they) made 6 javascripts for me.
I'm in an emergency situation now I have to comment those codes.
I could have done it by myself but.....I can't.....
So if someone can help me please fell free!!!!
And here comes the 5th one!
<html>
<title</title>
<head>
<link href="css.css" rel="stylesheet">
<style type="text/css">
body{
background-color:silver;}
.form{
position:absolute;
left:150px;
top:200px;
}
.txt{
font-family:arial;
font-size:10pt;
}
</style>
<script Language="JavaScript">
/* Denna funktion kollar igenom 3 strängar och ser om emailsträngen består av en nackademin.com adress
om addresen är sådan så skickas du till nästa sida*/
function isEmailAddr(email)
{
var result = false
var theStr = new String(email)
var index = theStr.indexOf("@nackademin.com");
if (index > 0)
{
var pindex = theStr.indexOf(".",index);
if ((pindex > index+1) && (theStr.length > pindex+1))
result = true;
}
return result;
}
function FormValidator(theForm)
{
if (theForm.email.value == "" || ! "@nackademin.com")
{
alert("Please enter a valid emailadress in the \"email\" field.");
theForm.email.focus();
return (false);
}
if (!isEmailAddr(theForm.email.value))
{
alert("Please enter a complete email address in the form:
[email protected]");
theForm.email.focus();
return (false);
}
if (theForm.email.value.length < 3)
{
alert("Please enter at least 3 characters in the \"email\" field.");
theForm.email.focus();
return (false);
}
return (true);
}
</script>
</head>
<body>
<div class="back"><a href="links.html">Tillbaka</a></div>
<div class="form">
<form method="POST" action="feedback.html" onsubmit="return FormValidator(this)" id=form4 name=form4>
<p class="txt">Email Address: <input type="text" name="email" size="25">
<input type="submit" value="Submit" name="submit"></p>
</form>
</div>
</body>
</html>
A big thanxs to all of you who helped me a lot!!!!
Thanxs!!!!!!