Validations in dataGrid
how i can do d validations for input text fields that come when i do edit command in datagrid.
for e.g. i need to validate a input text box text for not to be special char. when i do update.
Please tell me how can i write function for custom validator to restrict special char.s
function fn_isspChar(source, arguments)
{
var CheckArr = new Array("'","`","%","@","!","#","$","&","*","(",")", "[","]","{","}","^","#","&","\"","-","=","|","+",",");
for(i=0;i<CheckArr.length;i++)
{
if(arguments.Value.indexOf(CheckArr[i]) >=0)
{
//alert("cannot contain " + CheckArr[i]);
arguments.IsValid=false;
t = eval("document.all." + source.controltovalidate);
t.focus();
t.select();
//break;
}
else
{
arguments.IsValid=true;
}
}
}
i've written this function.
it works pretty gud when i put alert...
but it takes only last special char in the array "CheckArr " for check when i go for setting "IsValid" i.e. ","
|