Click here to Skip to main content
       

JavaScript

 
AnswerRe: onmouseover and document.getElementById Pinmemberjainsachin30-Nov-12 9:17 
Questiondisplaying different contentunder single layout Pinmemberradha123 from Hyderabad23-Nov-12 3:32 
AnswerRe: displaying different contentunder single layout Pinmembermanojwadnere28-Dec-12 0:07 
QuestionRegular expression PinmemberMember 962181822-Nov-12 2:25 
AnswerRe: Regular expression [modified] Pinmembern.podbielski22-Nov-12 20:00 
GeneralRe: Regular expression PinmvpManfred R. Bihy22-Nov-12 21:20 
GeneralRe: Regular expression Pinmembern.podbielski23-Nov-12 21:15 
Questionform validation Pinmembertherainking7821-Nov-12 22:07 
I had this form validating now it won't even run the first function. Any suggestions?
// JavaScript Document
function formValidation()
{
var uid = document.registration.userid;
var uname = document.registration.username;
var uadd = document.registration.address;
var uzip = document.registration.zip;
var uemail = document.registration.email;
if(userid_validation(uid))
  {
    if(allLetter(uname))
    {
      if(alphanumeric(uadd))
      {
        if(allnumeric(uzip))
        {
          if(ValidateEmail(uemail))
          {
        }
      }
    }
  }
return false;
}
function userid_validation(uid)
{
var letters = /^[A-Za-z]+$/;
var uid_len = uid.value.length;
  if (uid.value.match(letters))
    {
    return true;
    }
    else
    {
    alert("The First Name can not be empty/must         contain only letters");
    uid.focus();
   return false;
  }
}
function allLetter(uname)
{
var letters = /^[A-Za-z]+$/;
  if (uname.value.match(letters))
  {
   return true;
  }
  else
  {
  alert("The Last Name can not be empty/must  contain only letters");
  uname.focus();
  return false;
  }
}
function alphanumeric(uadd, num)
{
var uadd_len = uadd.value.length;
var numbers = /^[0-9]+$/;
if (uadd.value.match(numbers))
  {
  return true;
  }
  else
  {
  alert("Your phone number must have a 10 digits all numbers");
  uadd.focus();
  return false;
  }
}
function allnumeric(uzip)
{
var numbers = /^[0-9]+$/;
  if (uzip.value.match(numbers))
  {
  return true;
  }
  else
  {
  alert("You must fill in your ZIP code with five numeric characters");
  uzip.focus();
  return false;
  }
}
function ValidateEmail(uemail)
{
var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
  if(uemail.value.match(mailformat))
  {
  alert("Form Succesfully Submitted");
  window.location.reload();
  return true;
  }
  else
  {
  alert("You have entered an invalid email address!");
  uemail.focus();
  return false;
  }
 
}
chrishoy78@gmail.com

AnswerRe: form validation PinmvpRichard MacCutchan21-Nov-12 22:17 
GeneralRe: form validation Pinmembertherainking7828-Nov-12 13:14 
AnswerRe: form validation PinmemberbVagadishnu28-Nov-12 11:14 
GeneralRe: form validation Pinmembertherainking7828-Nov-12 13:17 
Questionopeing a new window in JS after time interval PinmemberWaqasCheema20-Nov-12 23:36 
AnswerRe: opeing a new window in JS after time interval PinmemberAndrew Stoute30-Nov-12 4:51 
QuestionDraw circuit diagram using javascript Pinmemberanishkannan18-Nov-12 22:31 
AnswerRe: Draw circuit diagram using javascript Pinmembern.podbielski19-Nov-12 21:07 
Answerto transfer items in select list to another select list without duplicates Pinmemberraviteja999200014-Nov-12 20:09 
QuestionHow does Yandex do its trick? PinmemberXarzu14-Nov-12 19:42 
AnswerRe: How does Yandex do its trick? [modified] PinmvpManfred R. Bihy14-Nov-12 20:44 
Questiondisplay record from two different time Pinmemberuti123fil8-Nov-12 17:15 
AnswerRe: display record from two different time PinmvpRichard MacCutchan8-Nov-12 23:47 
QuestionAdding a month to the current date PinmemberSadiqMohammed6-Nov-12 23:48 
AnswerRe: Adding a month to the current date PinmemberRichard Deeming7-Nov-12 2:00 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed7-Nov-12 18:31 
GeneralRe: Adding a month to the current date PinmemberRichard Deeming8-Nov-12 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 19 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid