SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checking to make sure field is not left blank

    I'm trying to have my script that would give an error on submit if a specific input was blank.

    This is what I have so far, but it doesn't seem to work.

    Any ideas whats wrong with it? Thanks.

    if(document.form.quest1.value=""){alert("Question One Blank");return false}

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    if(document.form.quest1.value==""){alert("Question One Blank");return false}

    You forgot an equal sign

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks stymiee.

    It's amazing how things can get all messed up over a tiny character omission.

    Its times like these I'm thankful I'm not the one doing the coding for nuclear missile software programs.

  4. #4
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    More then one $xxx,xxx,xxx space mission has been lost to a typo. It's true.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •