locked
Validation not working RRS feed

  • Question

  • User-1499457942 posted

    Hi

      I have below code but Required Field Validator is not working . Secondly i want Code textbox size should be small

    <div class="modal-body">
                        <div class="form-group">
                                <label for="No">No</label>
                                <asp:TextBox ID="txtNo"  CssClass="form-control input-sm"  runat="server" ></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfv1" CssClass="alert-danger" 
                                ControlToValidate="txtNo" ValidationGroup="save-modal" 
                                SetFocusOnError="true" Display="Dynamic" runat="server" 
                                ErrorMessage="Please Enter code!!!"></asp:RequiredFieldValidator>
    
                                <label for="Description">Description</label>
                                <asp:TextBox ID="txtDescription"  CssClass="form-control input-lg" runat="server" ></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfv2" CssClass="alert-danger" 
                                ControlToValidate="txtDescription" ValidationGroup="save-modal" 
                                SetFocusOnError="true" Display="Dynamic" runat="server" 
                                ErrorMessage="Please Enter Category Description!!!"></asp:RequiredFieldValidator>
    
                        </div>
                    </div>        

    Thanks

    Sunday, July 29, 2018 6:13 AM

Answers

  • User-1499457942 posted

    Working

    <asp:RequiredFieldValidator ID="rfv1" CssClass="text-danger" runat="server" ErrorMessage="This field is Required !" ControlToValidate="txtNo"></asp:RequiredFieldValidator>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 29, 2018 6:41 AM