R
Ric Castagna
Hello, all...
I'm trying to do a client-side validation on a databound dropdown
list.
All I want to do is check to see if the selected index is greater than
0 - an invalid option.
Here's the code I'm using, but I don't think the compare validator is
the right validation method to use. It, unfortunately, always thinks
there's an error.
<asp:dropdownlist id="ddlCategories" cssclass="adminText"
datatextfield="cat_desc" datavaluefield="cat_id" runat="server" />
<asp:comparevalidator id="cvCategories" operator="LessThan"
controltovalidate="ddlCategories" valuetocompare="1"
errormessage="Please select a category for this clip."
display="Dynamic" runat="server" />
I can't seem to find any postings on using validation against dropdown
lists on the client side, and I'd prefer to keep the validation there
as sending it server-side would really junk up the works.
Please help.
Thanks!
I'm trying to do a client-side validation on a databound dropdown
list.
All I want to do is check to see if the selected index is greater than
0 - an invalid option.
Here's the code I'm using, but I don't think the compare validator is
the right validation method to use. It, unfortunately, always thinks
there's an error.
<asp:dropdownlist id="ddlCategories" cssclass="adminText"
datatextfield="cat_desc" datavaluefield="cat_id" runat="server" />
<asp:comparevalidator id="cvCategories" operator="LessThan"
controltovalidate="ddlCategories" valuetocompare="1"
errormessage="Please select a category for this clip."
display="Dynamic" runat="server" />
I can't seem to find any postings on using validation against dropdown
lists on the client side, and I'd prefer to keep the validation there
as sending it server-side would really junk up the works.
Please help.
Thanks!