Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-09-2009
Member
 
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;}
}
}
Reply With Quote
  #2  
Old 26-09-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 08:15 AM.