Jump to content

form validation and includeing javascript in a <script> tag


PC Nerd

Recommended Posts

i have 2 quick questions


1.)  what would i compare to in this if condition, when testing to see if the email field has an @ symbol, and one "."?  if ( Email !=#Help Here#) { alert.......} would it be "!= *@*.*" ???



and 2.) ok, i have this script: B_A-New_Player_Valid.js and when i include it into my <head> of my html, it like blocks the css indluded file.  becauase all the color defined by the css script goes from the page.  why is this happening???, and what can i do to stop it.....????


here is the codefor both of the bove questions.:


[code]function New_Player_Valid() {

User_Name = window.document.B_A-New_Player.User_Name.value
Password = window.document.B_A-New_Player.Password.value
Re_Password = window.document.B_A-New_Player.Re_Password.value
Email = window.document.B_A-New_Player.Email.value
Re_Email = window.document.B_A-New_Player.Re_Email.value
F_Name = window.document.B_A-New_Player.F_Name.value
L_Name = window.document.B_A-New_Player.L_Name.value
Age = window.document.B_A-New_Player.Age.value
T+C = window.document.B_A-New_Player.T+C.value
P+P = window.document.B_A-New_Player.P+P.value




if (Password != Re_Pasword){alert("Your Passwords DO NOT Match.  Please change them so that they match");}
else if (Email != Re_Email){alert("Your Emails DO NOT Match.  Please change them so that they match");}
else if (T+C.checked != TRUE) {alert("You have not read the Terms and Conditions.  Please read the Terms and Conditions and then check the box");}
else if (P+P.checked != TRUE) {alert("You have not read the Privacy Policy.  Please read the Privacy Policy and then check the box");}
else if (User_Name.length < 4) {alert("Your User Name is less than 4 characters in length.  Please make your User Name between 4 and 14 characters in length");}
else if (User_Name.length > 14){alert("Your User NAme is more than 14 characters in length.  Please make your User Name between 4 and 14 characters in length");}
else if () {}

}[/code]




[code]<html>

<head>
<script language = "JavaScript" type = "text/Javascript" href = "JavaScript/B_A-New_Player_Valid.js"></script>
<link rel="stylesheet" type="text/css" src="B_A-CSS.css">

<title>Battle Ages New Player</title>
</head>[/code



i really appreciate your help, thank you in advance[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.