Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 3rd, 2004, 07:19 AM
Authorized User
 
Join Date: Oct 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Comments in my javascripts 5

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!!!!!!
 
Old November 4th, 2004, 10:31 AM
Authorized User
 
Join Date: Oct 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wrong codes I know

A big thanxs to all of you who helped me a lot!!!!
Thanxs!!!!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
IIS ->Javascripts, any clue? justboomit General .NET 1 July 2nd, 2007 08:32 AM
Comments in my javascripts 6 xristina Javascript 5 November 4th, 2004 04:08 PM
Comments in my javascripts 4 xristina Javascript 1 November 4th, 2004 10:31 AM
Comments in my javascripts xristina Javascript 2 November 4th, 2004 10:30 AM
Comments in my javascripts 2 xristina Javascript 1 November 3rd, 2004 09:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.