Results 1 to 2 of 2

Thread: javascript form validation

  1. #1
    Join Date
    26 Aug 2006
    Location
    Karachi
    Age
    32
    Posts
    268
    Threads
    74
    Credits
    0
    Thanked
    4

    Default javascript form validation




    var b=document.forms["form1"]["CorporateSignonUserName"].value;
    if (b==null || b=="")
    {
    alert("Please, Enter correct User ID.");
    return false;
    }
    me yeh use kar k check kr rha hu k mere form ka value box empty submit na ho..
    and me yeh bhi check karna chahta hu k us me koi bhi space na ho tau me b== k agay kya dalun jis se yeh check hojaye?
    Signature ITDUNYA.COM hai na

    Your Borther
    Junaid

  2. #2
    The Genius's Avatar
    The Genius is offline Advance Member
    Last Online
    4th November 2023 @ 12:27 AM
    Join Date
    21 Feb 2011
    Gender
    Male
    Posts
    977
    Threads
    16
    Credits
    668
    Thanked
    85

    Default

    Junaid Try this code.

    Hope this will help.

    var b=document.forms["form1"]["CorporateSignonUserName"].value;
    var pat = /\s/g;

    if (b == "" || pat.test(b)){

    alert("Please, Enter correct User ID.");

    }


Similar Threads

  1. MCAT Study Guides and Practice Tests
    By Dark Legion in forum E-Books
    Replies: 35
    Last Post: 15th November 2016, 12:49 PM
  2. Permision Form Jama karwane ki last date?
    By Ibrar6545 in forum Educational Help
    Replies: 0
    Last Post: 30th September 2013, 07:23 PM
  3. Html Form Problem
    By 5hoaib in forum Ask an Expert
    Replies: 6
    Last Post: 24th September 2012, 02:36 AM
  4. order/contact form
    By mohsinyounis in forum Ask an Expert
    Replies: 1
    Last Post: 12th January 2012, 11:15 AM
  5. NOw Come to jaa sCript :) Easy Hai Lear kArLaIN
    By Rau7* in forum English IT Zone
    Replies: 7
    Last Post: 29th July 2010, 10:49 AM

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
  •