Attached is a text script file w/c supposedly requies & validates 3 fields correctly..Name, Email and Telephone No.
At first i thought I finally got it to work...until i...well, tried putting in a long complete name...ex. Richard S. Small on the Name Field...it prompts an invalid username...apparently when you put in a name that breaks into more than two spaces it doesnt accept it...
Can you help me change whatever is wrong with this one?
Also, I think there's something that needs to be "improved" on the way I "validate" my Telephone field...and i think it "lacks" something at the end...
function isReady(form) {
if (isEmail(form.requiredemail.value) == false) {
alert("Please enter a valid email address.");
form.requiredemail.focus();
return false;
}
if (isProper(form.requiredname.value) == false || ((form.requiredname.value).split(" ")).length>1) {
alert("Please enter a valid username.");
form.requiredname.focus();
return false;
}
if (isNumber(form.requiredtelephone.value) == false) {
alert("Please enter a valid telephone no.");
form.requiredtelephone.focus();
return false;
}
return true;
}
with this one
function isReady(form) {
if (isEmail(form.requiredemail.value) == false) {
alert("Please enter a valid email address.");
form.requiredemail.focus();
return false;
}
if (isProper(form.requiredname.value) == false || ((form.requiredname.value).split(" ")).length>1) {
alert("Please enter a valid username.");
form.requiredname.focus();
return false;
}
if (isNumber(form.requiredtelephone.value) == false) {
alert("Please enter a valid telephone no.");
form.requiredtelephone.focus();
return false;
}
return true;
}
Thanks! I haven't actually..."applied & tested" it yet...but just out of curiosity...what were the changes that were made and why...what caused the error?
Your last post did the trick! I think i"ll try your Tel.number scheme too...moving forward, I think my "next" dilemma would be how to keep the fields (esp. the numbers fields) from being "under- fulfilled"...you know...like they have to put in "at least" 10digits/characters to make it a "valid field"...i also found out that because "-" and "()" are accepted as is...visitors can just type these instead of numbers...and still the field will validate it...
PeOfEo,
Hmmm...w/c one sorry man, i got at least a dozen of them floating around my pc...i sort of mixed them up whichever gets to work with the least & easiest modifications, i use immediately.... until i "break" them up..I think this one is the most "fixed" of the lot though..
Bookmarks