Results 1 to 2 of 2

Thread: validation help

  1. #1
    Join Date
    Nov 2008
    Posts
    20

    validation help

    I have a text box in a form that is validated to accept a value called ds01 but i also want the textbox to be allowed to accept empty spaces that is if nothing is entered in the textbox. The problem is that it does not accept anything other than ds01. Thanx in advance for your help. This is my script

    function validate_choice(field,alerttxt)
    {
    with (field)
    {
    if (value != "ds01")
    {
    alert(alerttxt);return false;
    }
    else if (value ==null || value == "" || value=="ds01")
    {
    return true;
    }
    }
    }

    function validate_form(thisform)
    {
    with (thisform)
    {
    if (validate_choice(webdev, "You Must Enter the Correct Code.Please Enter ds01!.Thank You!")==false)
    {webdev.focus();return false;}
    }
    }

  2. #2
    Join Date
    Apr 2009
    Posts
    61

    Re: validation help

    I will suggest you instead of providing ds01 as Input, try accepting your input value and in conditional statement keep if (value ==null || value == "" || value=="ds01"), henceforth it will ask for user input and if it is ds01 then fullfills the condition statement will be executed.

Similar Threads

  1. Custom Validation in asp.net
    By Elton John in forum Software Development
    Replies: 3
    Last Post: 12-01-2011, 12:24 PM
  2. How to use Attributes for Validation
    By Appaji in forum Software Development
    Replies: 5
    Last Post: 11-02-2010, 03:24 AM
  3. Textbox validation in ASP.NET
    By Kasper in forum Software Development
    Replies: 4
    Last Post: 19-01-2010, 08:28 PM
  4. CSS Validation problem
    By Camdean in forum Software Development
    Replies: 5
    Last Post: 29-12-2009, 06:47 PM
  5. WGA validation crack
    By migons in forum Operating Systems
    Replies: 4
    Last Post: 19-08-2009, 07:30 PM

Tags for this Thread

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
  •  
Page generated in 1,713,983,444.27590 seconds with 16 queries