Hi,
I'm trying to write a client validation function to be used by my ASP.NET CustomValidator control. Here is what I currently have:
In this function, sender is the CustomValidator control. Now, I need to enhance this so that this validation only occurs when a particular textbox control is enabled. Since both the TextBox and CustomValidator are built up dynamically as part of a GridView control, there is no way to predict what the id property will be.
Does anyone know how to get at the TextBox control so that I can check whether or not it is disabled?
Thx.
I'm trying to write a client validation function to be used by my ASP.NET CustomValidator control. Here is what I currently have:
Code:
function validateDays(sender, args) {
var days = parseFloat(args.Value);
if ((days > 0) && (days <= 1)) {
args.IsValid = true;
return;}
else {
args.IsValid = false;
return;}}
In this function, sender is the CustomValidator control. Now, I need to enhance this so that this validation only occurs when a particular textbox control is enabled. Since both the TextBox and CustomValidator are built up dynamically as part of a GridView control, there is no way to predict what the id property will be.
Does anyone know how to get at the TextBox control so that I can check whether or not it is disabled?
Thx.