Hello, I'm trying to implement custom validation for my web page, but having problem. I want my ComboBox to be populated asynchronously from Web Service. So, here's the code of my page:
And here's the code of the web service that I use for generating ComboBox items:
So, I have number of problems.
1) When I load the page and click "Submit" link, validation doesn't happen and page gets post back. Obviously, that's wrong because ComboBox doesn't have any item selected.
2) When I select an item I see "Required" text. That happens because when validation function is called, this code:
returns "undefined". Sure, that's not how I expect things to work. When I click "Submit" link everything works properly.
P.S. It can seem that I would use RequiredFieldValidator in this example, but sometimes I will need to change the way selection is validated, so I would prefer to use CustomValidator for this.