N
Nathan Sokalski
I am creating a validator by inheriting from the BaseValidator class, which
I have done many times before. I am working on creating the JavaScript to
add the client-side validation capability to the validator, which I know is
done by adding an evaluationfunction attribute, which I have also done
before. I have done this, but when validation occurs I receive a message
saying that the function does not exist. I did a view source, and both the
evaluationfunction attribute and JavaScript function are where they should
be. But the more confusing part is that if I remove the body from the
function (in other words, make a validation function that doesn't do
anything), than doesn't complain or give any errors. I even tried adding the
one variable declaration, and it didn't hurt anything. The first thing I
narrowed it down to that gave me this error is the following:
for(var opt in
document.getElementById(val.clientid).options[]){document.writeln(opt.text);}
As you can see, this is a <select> element (which in this case came from a
ListBox) and I am just displaying the text of all the items (my actual
function does more, but I figure I should just try to access a simple text
property before perfecting the rest of my code). Because adding this line is
what causes me to get the error saying my function doesn't exist, I was
wondering if anyone sees anything in this code (NOTE: val.clientid is an
attribute I added as part of my validator's code, val is the name I used as
the parameter name in my function). Any help would be appreciated. Thanks.
I have done many times before. I am working on creating the JavaScript to
add the client-side validation capability to the validator, which I know is
done by adding an evaluationfunction attribute, which I have also done
before. I have done this, but when validation occurs I receive a message
saying that the function does not exist. I did a view source, and both the
evaluationfunction attribute and JavaScript function are where they should
be. But the more confusing part is that if I remove the body from the
function (in other words, make a validation function that doesn't do
anything), than doesn't complain or give any errors. I even tried adding the
one variable declaration, and it didn't hurt anything. The first thing I
narrowed it down to that gave me this error is the following:
for(var opt in
document.getElementById(val.clientid).options[]){document.writeln(opt.text);}
As you can see, this is a <select> element (which in this case came from a
ListBox) and I am just displaying the text of all the items (my actual
function does more, but I figure I should just try to access a simple text
property before perfecting the rest of my code). Because adding this line is
what causes me to get the error saying my function doesn't exist, I was
wondering if anyone sees anything in this code (NOTE: val.clientid is an
attribute I added as part of my validator's code, val is the name I used as
the parameter name in my function). Any help would be appreciated. Thanks.