I am trying to validate the following form. I have three validations working but need to validate all but the M-F drop down menu.
Can anyone help me?
I have tried a validation that I found for zip codes, but when I add it to what I already have, it makes the entire form stop working. I am pasting what I have that is working. I took out the javascript that was making it not work.
If anyone has an answer for me, I REALLY need you to be clear on how and where I call up the code.
I was doing the zip code with an onBlur and I left the on Blur in the code so that you could see it.
Thanks! You guys have always been great to me!!
Cool
/////////////////////////////////////////////////////////
//Checking for the @ and the "dot" in an email
/////////////////////////////////////////////////////////
function isANumber(inputValue){
// Assume everything is okay
var result = true
// If parseFloat() returns false, a non-numeric character
// was detected in the first position
if (!parseFloat(inputValue)) {
result = false
}
// Otherwise, we still have to check the rest of the digits,
// so step through the inputValue one character at
// a time and set result = false if any non-numeric
// digits are encountered.
else {
for (var i=0; i<inputValue.length; i++) {
if (inputValue.charAt(i) != " ") {
if (!parseFloat(inputValue.charAt(i))) {
result = false
break
}
}
}
}
// Return true (inputValue is a valid number) or
// false (it's invalid).
return result
}
function isAValidEmail(inputValue) {
var foundAt = false
var foundDot = false
var atPosition = -1
var dotPosition = -1
// Step through each character of the e-mail
// address and set a flag when (and if) an
// @ sign and a dot are detected.
for (var i=0; i<=inputValue.length; i++) {
if (inputValue.charAt(i) == "@" ) {
foundAt = true
atPosition = i
}
else if (inputValue.charAt(i) == ".") {
foundDot = true
dotPosition = i
}
}
//If both an @ and a "." are found and in right order
if ((foundAt && foundDot) && (atPosition < dotPosition)) {
// It's a valid e-mail address
return true
}
else {
// The e-mail address is invalid
alert("Sorry, you entered an invalid e-mail address. Please try again.")
return false
}
}
function exists(inputValue) {
var aCharExists = false
// Step through the inputValue, using the charAt()
// method to detect non-space characters.
Hello, I need help with my signup page.Once I added a little coding the two fields (Password and Re-enter Password) when not the same wont popup a message anymore.Here is my coding copied.
<html>
<head>
<style type="text/css">
A:link
{ text-decoration: none; }
body
{ background-color: #FFCC00; }
</style>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkPw(form) {
pw1 = form.pw1.value;
pw2 = form.pw2.value;
if (pw1 != pw2) {
alert ("\nYou did not enter the same new password twice. Please re-enter your password.")
return false;
}
else return true;
}
// End -->
</script>
<center>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function verify() {
var themessage = "You are required to complete the following fields: ";
if (document.form.first.value=="") {
themessage = themessage + " - First Name";
}
if (document.form.last.value=="") {
themessage = themessage + " - Last Name";
}
if (document.form.pw1.value=="") {
themessage = themessage + " - Password";
}
if (document.form.pw2.value=="") {
themessage = themessage + " - Confirm Password";
}
if (themessage == "You are required to complete the following fields: ") {
document.form.submit();
}
else {
alert(themessage);
return false;
}
}
// End -->
</script>
</center>
</head>
<body>
<center>
Under Construction<br>
<br>
<form name=form method="post" action="" onSubmit="return checkPw(this)">
<center>
First Name:<input type=text name="first" size="20"><BR>
Last Name:<input type=text name="last" size="20"><BR>
I am certainly no genius, but why do you have two sets of Javascript?
I have never seen it done that way. Why don't you put it all in one?
And...should it be...
<body background-color="#whatever?">
Bookmarks