JavaScript Conform DialogBox is not Working,If I put Asp.Net Validation Control -


in form there 2 textboxes , button value submit. if user clicks on submit button after entering values in textboxes value of button changes success i.e submit button becomes success button,

but problem when user clicks on submit button without entering values in textboxes shows required field validation @ same time submit button becomes success button form not submitted.

<form id="form1" runat="server">//code in default.aspx page <div> <div>         <br />     <asp:textbox id="textbox1" runat="server" width="242px"></asp:textbox>     <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server"          controltovalidate="textbox1" errormessage="requiredfieldvalidator"          validationgroup="s"></asp:requiredfieldvalidator>     <br />     <br />     <asp:textbox id="textbox2" runat="server" width="242px"></asp:textbox>     <asp:requiredfieldvalidator id="requiredfieldvalidator2" runat="server"          controltovalidate="textbox2" errormessage="requiredfieldvalidator"          validationgroup="s"></asp:requiredfieldvalidator>     <br />     <br />       <asp:button id="btn1" runat="server" text="mybutton"          onclientclick="hello();"           onclick="btn1_click" validationgroup="s" />       </div>       </div>    </form>    //code in default.aspx.cs page    using system;   using system.collections.generic;   using system.linq;   using system.web;   using system.web.ui;   using system.web.ui.webcontrols;      public partial class _default : system.web.ui.page      {        protected void page_load(object sender, eventargs e)         {          }          protected void btn1_click(object sender, eventargs e)         {            btn1.text = "success";         }      } 

remove

onclientclick="hello();"  

what used for

or if using hope u have added below function in script

<script type="text/javascript">  function hello() { } </script> 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -