Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Validate AJAX ComboBox Control using Validation Control

$
0
0

Hi all,

How can i validate AJAX ComboBox Control using Validation Control

i tried this but not work with me

<asp:ComboBox ID="cmb_Qualification" runat="server" DropDownStyle="DropDownList" AppendDataBoundItems="true" CssClass="GreenTypeComboBoxStyle" AutoCompleteMode="SuggestAppend" RenderMode="Block" CaseSensitive="False" AutoPostBack="True" OnSelectedIndexChanged="cmb_Qualification_SelectedIndexChanged"><asp:ListItem Text="" Value="-1" Selected="True"></asp:ListItem></asp:ComboBox><asp:RequiredFieldValidator ID="rfvQualification" runat="server" ControlToValidate="cmb_Qualification" SetFocusOnError="false" ValidationGroup="EQ" InitialValue="-1">*</asp:RequiredFieldValidator>

and also this one and not work with me

<script>
    //-- To Validate AJAX ComboBox Control
    function CustomValidator(s, e) {
        if ($find(s.controltovalidate)._textBoxControl.value == "-1") {
            e.IsValid = false;
        }
    }</script><asp:ComboBox ID="cmb_Qualification" runat="server" DropDownStyle="DropDownList" AppendDataBoundItems="true" CssClass="GreenTypeComboBoxStyle" AutoCompleteMode="SuggestAppend" RenderMode="Block" CaseSensitive="False" AutoPostBack="True" OnSelectedIndexChanged="cmb_Qualification_SelectedIndexChanged"><asp:ListItem Text="" Value="-1" Selected="True"></asp:ListItem></asp:ComboBox><asp:CustomValidator ID="cvQualification" runat="server" ErrorMessage="CustomValidator" SetFocusOnError="true" ValidationGroup="EQ" ClientValidationFunction="CustomValidator" ControlToValidate="cmb_Qualification">*</asp:CustomValidator>--%>

so can anyone tell me how to do it?

Thanks




Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>