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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.