Web Connection
Disabling Submit Button not executing Click Event
<ww:wwWebButton ID="btnSubmit" runat="server"
Width="100" Click="btnSubmit_Click" Text="Submit" />
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#frmeMailReport").submit(function (e) {
//stop submitting the form to see the disabled button effect
//e.PreventDefault();
//disable the submit button
$("#btnSubmit").attr("disabled",true);
return true;
});
});
</script>
<
The Submit button is disabled but the Click="btnSubmit_Click" is not executed. Seem to be missing something.
If you disable the button, the button's name is not included in the POST data to the server and if I recall right the server won't see the event. Turn on logging on the server and see what's in the POST data and compare between disabling and not disabling and see what difference that makes and whether it even hits the server with the button disabled.
+++ Rick ---
Panel_btnSubmit=Submit
Above is missing when the Submit button is disabled.
<% pcPageTitle = "Reports" %>
<% Layout="~/views/_layoutpage.wcs" %>
<td class="blockheader" align="center" valign="top" style="height: 40px; ">
<button type="submit" id="btnSubmit" name="btnSubmit" style="width: 120px"
<i class="fa fa-check"></i> Submit
</button>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#frmReports").submit(function (e) {
//stop submitting the form to see the disabled button effect
//e.preventDefault();
//disable the submit button
$("#btnSubmit").attr("disabled", true);
//disable a normal button
$("#btnTest").attr("disabled", true);
return true;
});
});
</script>
The above code works but the submit button is not passed but the code I want to run is in the post back which is executed without needing to execute a "Click Event"