J
Jim Heavey
Hello, I was am wanting to validate that a user has made a selection from a
dropdownlist control in a datagrid. Is my only option to use a
"CustomValidator Control"? I am not quite sure how to write and attach
JavaScript to the control to ensure the SelectedIndex > -1. Is there a way
to do this in JavaScript (can you provide an example?) or should I just
write Server side validation?
Example:
<aspropDownList ID="ddlRating" Runat="server" DataSource="<%#
dtRating %>" DataTextField="Description" DataValueField="Rating" Font-
Size="8"></aspropDownList>
<asp:CustomValidator ID="cvlRating" ControlToValidate="ddlrating"
Display="Dynamic" ErrorMessage="Must make a selection">
</asp:CustomValidator>
dropdownlist control in a datagrid. Is my only option to use a
"CustomValidator Control"? I am not quite sure how to write and attach
JavaScript to the control to ensure the SelectedIndex > -1. Is there a way
to do this in JavaScript (can you provide an example?) or should I just
write Server side validation?
Example:
<aspropDownList ID="ddlRating" Runat="server" DataSource="<%#
dtRating %>" DataTextField="Description" DataValueField="Rating" Font-
Size="8"></aspropDownList>
<asp:CustomValidator ID="cvlRating" ControlToValidate="ddlrating"
Display="Dynamic" ErrorMessage="Must make a selection">
</asp:CustomValidator>