Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 516.8k

Validation on Client Side

May 31 2023 1:16 AM

Hi

  I have below code . I want ChildName should accept only Alphabets , Spaces , Backspace & . 

Child Age should accept onlt 1-100 values. Message should appear in modal popup

<asp:Repeater ID="rptBulkDataLead" runat="server">
    <ItemTemplate>
        <tr>
            <td>
                <asp:HiddenField ID="hdfLeadID" runat="server" Value='<%# Eval("LeadID") %>' />
                <asp:Literal ID="ltrlNum" Text="<%# Convert.ToString(Container.ItemIndex + 1) %>" runat="server"></asp:Literal></td>
            <td>
                <asp:Literal ID="ltrlLeadNumber" runat="server" Text='<%# Eval("LeadNumber") %>'></asp:Literal></td>

            <td>
                <asp:TextBox ID="txtChildName" runat="server" class="form-control" Text='<%# Eval("ChildName") %>' ></asp:TextBox></td>
            <td>
                <asp:TextBox ID="txtChildAge" runat="server" class="form-control" Text='<%# Eval("ChildAge") %>' ></asp:TextBox>
                <%-- <asp:RangeValidator ID="rangeValidatorChildAge" runat="server" ControlToValidate="txtChildAge"
                    MinimumValue="0" MaximumValue="100" Type="Integer" ErrorMessage="Age should be between 0 and 100."
                    Text="*"></asp:RangeValidator>--%>
            </td>
        </tr>
    </ItemTemplate>
</asp:Repeater>

Thanks


Answers (1)