<div class="container"> <div id="myModal" class="modal payout" data-bs-backdrop="static" data-bs-keyboard="false" aria-hidden="true" role="dialog">
<%-- <div class="modal payout" id="myModal" role="dialog" aria-hidden="true" data-bs-backdrop='static' data-bs-keyboard="false">--%> <div class="modal-dialog"> <div class="modal-content"> <div id="form1" class="box-body" runat="server">
<!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Add New Beneficiary</h4> <button type="button" class="close" data-bs-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <div class="row"> <div class="mb-3 col-md-4"> <%--<label>Bank</label>--%> <asp:Label ID="lblbank" runat="server">Bank</asp:Label> <div class="input-group"> <%-- <select class="form-control form-control-sm" > <asp:DropDownList ID="ddlbank" runat="server" ></asp:DropDownList> <option>SBI</option> <option>SBI</option> <option>SBI</option> <option>SBI</option>
</select>--%> <asp:DropDownList ID="ddlbanks" runat="server" CssClass="form-control form-control-sm" ></asp:DropDownList> </div> </div> <div class="mb-3 col-md-4"> <%-- <label>Beneficiary Account Number</label>--%> <asp:Label ID="lbl1" runat="server">Beneficiary Account Number</asp:Label> <div class="input-group"> <%-- <input class="form-control form-control-sm" placeholder="Enter Beneficiary Account Number" > --%> <asp:TextBox ID="TxtBeneficiaryAccountNumber" runat="server" CssClass="form-control form-control" placeholder="Enter Beneficiary Account Number" value=""></asp:TextBox> </div> </div> <div class="mb-3 col-md-4"> <%-- <label>Confirm Account Number</label>--%> <asp:Label ID="lblconfirmacnum" runat="server">Confirm Account Number</asp:Label> <div class="input-group"> <%-- <input class="form-control form-control-sm" placeholder="Enter Confirm Account Number" > --%> <asp:TextBox ID="TxtConfirmBeneficiaryAccountNumber" runat="server" CssClass="form-control form-control-sm" placeholder="Enter Confirm Account Number" ></asp:TextBox>
</div> </div> <div class="mb-3 col-md-4"> <%--<label>Beneficiary Name</label>--%> <asp:Label ID="benename" runat="server">Beneficiary Name</asp:Label> <div class="input-group"> <%-- <input class="form-control form-control-sm" placeholder="Enter Beneficiary Name" > --%> <asp:TextBox ID="TxtBeneficiaryName" runat="server" CssClass="form-control form-control-sm" placeholder="Enter Beneficiary Name" ></asp:TextBox>
</div> </div> <div class="mb-3 col-md-4"> <%-- <label>IFSC Code</label>--%> <asp:Label ID="ifsc" runat="server">IFSC Code</asp:Label> <div class="input-group"> <%-- <input class="form-control form-control-sm" placeholder="Enter IFSC Code" > --%> <asp:TextBox ID="TxtBeneficiaryIFSC" runat="server" CssClass="form-control form-control-sm" placeholder="Enter IFSC Code" ></asp:TextBox>
</div> </div> <div class="form-group row"> <span>Do You Have IFSC Code</span>
<div class="col-md-2"> <div class="radioborder"> <asp:RadioButton ID="rbtyes" runat="server" CssClass="form-check-input" GroupName="N" /> <asp:Label ID="lblno" runat="server">YES</asp:Label> </div> </div> <div class="col-md-2"> <div class="radioborder"> <asp:RadioButton ID="rbtno" runat="server" CssClass="form-check-input" GroupName="N" /> <asp:Label ID="lblyes" runat="server">No</asp:Label> </div> </div> </div> </div> <div class="otp" id="divotpfiels" runat="server" visible="false"> <div class="row"> <div class="mb-3 col-md-4"> <%--<label>OTP</label>--%> <asp:Label ID="Label19" runat="server">OTP</asp:Label> <div class="input-group"> <%-- <input class="form-control form-control-sm" placeholder="Enter Otp" > --%> <asp:TextBox ID="TxtBeneficiaryOTP" runat="server" CssClass="form-control form-control-sm" placeholder="Enter Otp"></asp:TextBox> </div> </div> </div> <div class="row"> <div class="mb-3 col-md-4"> <%-- <button class="resend">Resend OTP?</button>--%> <button type="button" runat="server" id="btnresendOTP" class="resend" onserverclick="ResendOTP_Click">Resend OTP?</button> </div> </div> </div> </div> </div> <div class="modal-footer">
<div class="row w-100"> <div class="col-md-4" id="divAddben" runat="server"> <%-- <button class="btn btn-primary">Add Beneficiary</button>--%> <button class="btn btn-primary" runat="server" id="btnaddbeneficiary" type="button" onserverclick="btnAddBene_ServerClick">Add Beneficiary</button> </div> <div class="col-md-4" id="divvalidate" runat="server" visible="false"> <button type="button" id="btnsubmitOTP" runat="server" class="btn btn-primary" onserverclick="VerifyOTP">Validate OTP</button> </div> </div>
</div> </div> </div> </div> </div>|
function showModal() { debugger; var beneficiaryAccountNumber = $('#<%=TxtBeneficiaryAccountNumber.ClientID %>').val(); var confirmBeneficiaryAccountNumber = $('#<%=TxtConfirmBeneficiaryAccountNumber.ClientID %>').val(); var beneficiaryName = $('#<%=TxtBeneficiaryName.ClientID %>').val(); var ifscCode = $('#<%=TxtBeneficiaryIFSC.ClientID %>').val();
if (beneficiaryAccountNumber.trim() === ',' || (beneficiaryAccountNumber.includes(',') && !beneficiaryAccountNumber.replace(/,/g, '').trim())) { $('#myModal input[type="text"]').val(''); } if (beneficiaryAccountNumber !== null && beneficiaryAccountNumber !== undefined && beneficiaryAccountNumber !== '') { beneficiaryAccountNumber = removeCommas(beneficiaryAccountNumber); } if (confirmBeneficiaryAccountNumber !== null && confirmBeneficiaryAccountNumber !== undefined && confirmBeneficiaryAccountNumber !== '') { confirmBeneficiaryAccountNumber = removeCommas(confirmBeneficiaryAccountNumber); } if (beneficiaryName !== null && beneficiaryName !== undefined && beneficiaryName !== '') { beneficiaryName = removeCommas(beneficiaryName); } if (ifscCode !== null && ifscCode !== undefined && ifscCode !== '') { ifscCode = removeCommas(ifscCode); } $("#myModal").modal("show"); return false; }
function removeCommas(input) { return input.replace(/,/g, ''); } here by default i am getting camma , value in the textbox after using the $('#myModal input[type="text"]').val('');line the cammas not getting but after entering values i am calling the script in .cs code ScriptManager.RegisterStartupScript(this, this.GetType(), "ErrorMSg", "<script>alert('OTP has been sent to Sender Mobile Number.');</script>", false); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowModal", "showModal();", true); here with the values the camma also adding after my data how to remove the camma