Javascript validation in asp.net for a textbox and dropdown
-
plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks
hey go to Google
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks
Well, if you want to hire someone to do your job for you, the job board is just over there. On the other hand, if you intend on being a programmer yourself, you should look up regular expression validators in that book that you surely bought to help you learn ASP.NET.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks
use
onblur="javascript: return reqcheck()" id="txt"
function reqcheck()
{
var txt = document.getElementById('txt');
if(txt.value.length == 0) return false;
return true;
}:rose:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
use
onblur="javascript: return reqcheck()" id="txt"
function reqcheck()
{
var txt = document.getElementById('txt');
if(txt.value.length == 0) return false;
return true;
}:rose:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
Um, this will return true or false for one of the cases he mentioned, but how will it perform validation ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Um, this will return true or false for one of the cases he mentioned, but how will it perform validation ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
I dont know why those people dont use
RequiredFieldValidators
orRegularExpressionValidators
for this.... I think those checks both in server as well as client.. :-D :-D Anyway, he can trap others inform onsubmit="javascript: return validatefunction();"
I guess. I thought he can do the others himself. ;P ;P :rose:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
I dont know why those people dont use
RequiredFieldValidators
orRegularExpressionValidators
for this.... I think those checks both in server as well as client.. :-D :-D Anyway, he can trap others inform onsubmit="javascript: return validatefunction();"
I guess. I thought he can do the others himself. ;P ;P :rose:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
Abhishek Sur wrote:
I thought he can do the others himself.
*grin* if he were capable of that, he'd be capable of working out what a regularexpressionvalidator was.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Abhishek Sur wrote:
I thought he can do the others himself.
*grin* if he were capable of that, he'd be capable of working out what a regularexpressionvalidator was.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
:laugh: Yes you are right. ;P
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks
MSDN is a primary resource for this type of doubts, Have a look at Validator Controls. :)
Arun Jacob http://codepronet.blogspot.com/