A
Assimalyst
Hi,
I have a code that returns invalid if a dropdownlist is at index 0.
function clientValidateCboBx(source, args)
{
var dropdown = document.getElementById(source.controltovalidate);
if(dropdown.selectedIndex == 0)
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
As above it works fine, but I want it to only return invalid if the
control it's validating is enabled, if it's disabled it should always
be valid. I tried adding && dropdownlist.enabled == true to the if
statement, but then the validator always returns true even when the
selectedIndex == 0.
Any ideas on a solution?
Thanks
I have a code that returns invalid if a dropdownlist is at index 0.
function clientValidateCboBx(source, args)
{
var dropdown = document.getElementById(source.controltovalidate);
if(dropdown.selectedIndex == 0)
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
As above it works fine, but I want it to only return invalid if the
control it's validating is enabled, if it's disabled it should always
be valid. I tried adding && dropdownlist.enabled == true to the if
statement, but then the validator always returns true even when the
selectedIndex == 0.
Any ideas on a solution?
Thanks