Asked by:
button not firing

Question
-
User181930479 posted
simply my asp button wont fire anymore...
below is my code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InternalReg.aspx.cs" Inherits="InternalReg" %> <%@ Register TagPrefix="asp" Namespace="Saplin.Controls" Assembly="DropDownCheckBoxes" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/droid-arabic-naskh" type="text/css"/> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function () { toggleFields00(); $("#DDLregSources").change(function () { toggleFields00(); }); }); function toggleFields00() { var conceptName = $('#DDLregSources').find(":selected").text(); if (conceptName == "sss" ) { $("#txtnameofJiha").hide(), $("#jihaICON").hide(), $('#txtnameofJiha').attr('value', 'FromDB'), $("#DropDownListofMinistries").show(); } else { $("#txtnameofJiha").show(), $("#jihaICON").show(), $("#DropDownListofMinistries").hide(), $("#bagsofministries").hide(), $('#txtnameofJiha').attr('value', ''); } } </script> <script type="text/javascript"> $(document).ready(function () { toggleFields00(); $("#DDLregSources").change(function () { toggleFields01(); }); }); function toggleFields01() { var conceptName1 = $('#DDLregSources').find(":selected").text(); alert(conceptName1); if (conceptName1 == "asa") { $('#txtnameofJiha').attr('value', 'sao - 11'); } else { $('#txtnameofJiha').attr('value', ''); } } </script> <style type="text/css"> label { font-family:Arial; font-size:medium; color:#000000 !important; } .goright { direction:rtl !important; text-align:right !important; } .navbar { border-bottom: 1px solid #b68a35 !important;} html, body{ height: 100%; } body { background-image: url('images/request-bg.jpg'); background-repeat: no-repeat; background-attachment: fixed; background- center; height:100vh; background-size: cover; width: 100%; } div, body{ margin: 0; padding: 0; font-family: exo, sans-serif; } .wrapper { height: 100%; width: 100%; } .form-control { background-color:black; opacity:0.7; color:#ffffff; } .navbar { ; } .brand { ; left: 50%; margin-left: -50px !important; /* 50% of your logo width */ display: block; } .ckSelector { direction:rtl !important; font-family: 'DroidArabicNaskhRegular'; font-weight: normal; font-style: normal; text-align: right !important; font-size:larger; } div.dd_chk_select div#caption { font-size:20px !important; text-align:right !important; height:25px !important; } .ckh { height:30px !important; } div.dd_chk_drop{ margin-top:20px !important; } </style> <script> function checkPasswordMatch() { var password = $("#txtPassword").val(); var confirmPassword = $("#txtPasswordCheck").val(); if (password != confirmPassword) $("#divCheckPasswordMatch").html("Password not matching").css({"color":"green", "font-size":"large","text-align":"center","background-color":"#000000","width":"83%"}); else $("#divCheckPasswordMatch").html("exact password").css({"color":"#ffffff", "font-size":"large","text-align":"center"}); } $(document).ready(function () { $("#txtPasswordCheck").keyup(checkPasswordMatch); }); </script> <style> .fromDB { direction:rtl !important; height:40px !important; font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal; } #DropDownCheckBoxes1 label{margin-right:10px;} </style> </head> <body style="height:1100px"> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div style="text-align:center !important; width:100%;" class="navbar-header"> <%-- <h1 style="margin:0 auto; ; color:#ffffff;">G00 </h1> --%> </div> <img src="img/V3NAV.png" style="width:80px;height:80px;" class="brand" /> <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav"> </ul> <%-- <ul class="nav navbar-nav navbar-right"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> </ul>--%> </div> </div> </nav> <br /> <br/> <br /> <br /> <div class="container"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;text-align:center;color:#ffffff;" class="col-sm-12"> REQUEST FOR </div> <div class="page-header"> </div> <div class="row"> <div class="col-sm-12" > <form id="form1" runat="server" class="form-horizontal"> <div class="form-group has-success has-feedback "> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:DropDownList required ID="DDLregSources" AppendDataBoundItems="true" runat="server" CssClass="form-control pull-left fromDB" DataSourceID="SqlDataSource1" DataTextField="SourceRequester" DataValueField="RegSourceID"> <asp:ListItem Text="PLEASE SELECT" Value="" /> </asp:DropDownList> <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:UAE_OG-InteranlConnectionString %>' SelectCommand="SELECT * FROM [tbl_sourceRequesters]"></asp:SqlDataSource> <span class="glyphicon glyphicon-briefcase form-control-feedback"></span> </div> <%-- <label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >TYPE</label>--%> </div> <div class="form-group has-success has-feedback "> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:DropDownList required ID="DropDownListofMinistries" AppendDataBoundItems="true" runat="server" CssClass="form-control pull-left fromDB" DataSourceID="SqlDataSource2" DataTextField="MinistryName" DataValueField="MinistryName"> <asp:ListItem Text="PLEASE SELECT m" Value="" /> </asp:DropDownList> <asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString='<%$ ConnectionStrings:UAE_OG-InteranlConnectionString %>' SelectCommand="SELECT * FROM [tbl_Minis]"></asp:SqlDataSource> <span id="bagsofministries" class="glyphicon glyphicon-briefcase form-control-feedback"></span> </div> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtnameofJiha" runat="server" placeholder="" class="form-control goright" required /> <span id="jihaICON" class="glyphicon glyphicon-user form-control-feedback"></span> </div> <%-- <label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >ة</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <select style="direction:rtl !important; height:40px !important;" class="form-control pull-left" id="Select1" required runat="server"> <option>PLEASE SELECT</option> <option>1</option> <option>11</option> <option>111</option> </select> <span class="glyphicon glyphicon-modal-window form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >office</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtpersonNameResponsible" runat="server" placeholder=" " class="form-control goright" required /> <span class="glyphicon glyphicon-user form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >P name</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <select style="direction:rtl !important; height:40px !important;" class="form-control pull-left" id="Select3" required runat="server"> <option>please select</option> <option>01</option> <option>02</option> <option>03</option> </select> <span class="glyphicon glyphicon-modal-window form-control-feedback"></span> </div> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtEmail" runat="server" placeholder="" class="form-control goright" required /> <span class="glyphicon glyphicon-envelope form-control-feedback"></span> </div> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtMobileNumber" runat="server" placeholder="" class="form-control goright" required /> <span class="glyphicon glyphicon-earphone form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >mobile</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtlandline" runat="server" placeholder="" class="form-control goright" required /> <span class="glyphicon glyphicon-home form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >landline</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtUsername" runat="server" placeholder="" class="form-control goright" required /> <span class="glyphicon glyphicon-user form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >User Name</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" placeholder="Password" class="form-control goright" required /> <span class="glyphicon glyphicon-option-horizontal form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >Password</label>--%> </div> <div class="form-group has-success has-feedback"> <div style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="col-sm-12"> <asp:TextBox ID="txtPasswordCheck" onChange="checkPasswordMatch();" TextMode="Password" runat="server" class="form-control goright" /> <span class="glyphicon glyphicon-option-horizontal form-control-feedback"></span> </div> <%--<label style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; font-style: normal;" class="control-label col-sm-2"" >confirm password</label>--%> </div> <div class="registrationFormAlert" id="divCheckPasswordMatch"> </div> <hr /> <br /> <fieldset class="scheduler-border"> <legend style="font-family: 'DroidArabicNaskhRegular';font-weight: normal; text-align:right !important; font-style: normal; color:#ffffff;" class="scheduler-border">العمليات المسموحة</legend> <div class="control-group"> <asp:DropDownCheckBoxes CssClass="ckh" ID="DropDownCheckBoxes1" runat="server" UseSelectAllNode = "false"> <Style SelectBoxWidth="80%" SelectBoxCssClass="ckh" DropDownBoxCssClass="ckSelector" DropDownBoxBoxWidth="80%" DropDownBoxBoxHeight="120" /> <Texts SelectBoxCaption="select from below" /> <Items > <asp:ListItem Text="ability to search" Value="ability to search"></asp:ListItem> <asp:ListItem Text="ability to search1" Value="ability to search1"></asp:ListItem> <asp:ListItem Text="ability to search2" Value="ability to search2"></asp:ListItem> <asp:ListItem Text="ability to search3" Value="ability to search3"></asp:ListItem> </Items> </asp:DropDownCheckBoxes> <asp:ExtendedRequiredFieldValidator CssClass="ckSelector" ID = "ExtendedRequiredFieldValidator1" runat = "server" ControlToValidate = "DropDownCheckBoxes1" ErrorMessage = "Must Select" ForeColor = "WindowFrame"></asp:ExtendedRequiredFieldValidator> </div> </fieldset> <br /> <div style="margin-bottom:20px;"> </div> <asp:Button Text="Register New" runat="server" ID="registerGOV" class="btn btn-default" OnClick="registerGOV_Click" /> </div> </div> </div> </form> </body> </html>
Thursday, October 4, 2018 8:49 AM
All replies
-
User1204533129 posted
Can you clarify bit more regarding your question ?
r u saying 'registerGOV_Click' event not hitting breakpoint ?
Thursday, October 4, 2018 6:59 PM -
User181930479 posted
yes this is what im saying .
Friday, October 5, 2018 4:39 AM -
User839733648 posted
Hi NAF,
According to your code and description, I could not reproduce your problem.
imply my asp button wont fire anymore...My understanding is that your button can't trigger an event when pressed.
I could not find the event from your code provided.
If possible, please provide more detailed codes like your code-behind(including the click event).
This will be easier for us to help with you.
Best Regards,
Jenifer
Friday, October 5, 2018 7:30 AM -
User181930479 posted
i have found that every time i disable the jquery code i wrote for hiding and showing some fields the button is firing again , for some reasons that are unknown for me i dont know why ..
below is the code that when i disable it , the button will fire :
<script type="text/javascript"> $(document).ready(function () { toggleFields00(); $("#DDLregSources").change(function () { toggleFields00(); }); }); function toggleFields00() { var conceptName = $('#DDLregSources').find(":selected").text(); if (conceptName == "sss" ) { $("#txtnameofJiha").hide(), $("#jihaICON").hide(), $('#txtnameofJiha').attr('value', 'FromDB'), $("#DropDownListofMinistries").show(); } else { $("#txtnameofJiha").show(), $("#jihaICON").show(), $("#DropDownListofMinistries").hide(), $("#bagsofministries").hide(), $('#txtnameofJiha').attr('value', ''); } } </script>
Friday, October 5, 2018 9:34 AM -
User61956409 posted
Hi NAF,
<asp:TextBox ID="txtnameofJiha" runat="server" placeholder="" class="form-control goright" required />
In your code, we can find that you specify the required attribute to TextBox "txtnameofJiha", which makes that input field must be filled out before submitting the form.
Please debug your JavaScript function toggleFields00() and check if it assigns a '' value to that TextBox control which causes server-side code of button click event not firing.
With Regards,
Fei Han
Monday, October 8, 2018 6:30 AM