I have a button
and a dropdownlst
And I have this script :
$("form").submit(function (e)
{
$('#divOverlay').show();
});
My Goal :
When a form submits , I need to show a "loading div
" :
Question :
When I press the button it does show me the div (the gray div which blinks for a second):
But when I change index on the dropdownlist :
<asp:DropDownList runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged" AutoPostBack="True">
<asp:ListItem Value="a"> a</asp:ListItem>
<asp:ListItem Value="b">b</asp:ListItem>
</asp:DropDownList>
It does submit bUt I dont see the div :
Why does the $("form").submit(function (e)
does not capture this postback which occurs after selected index change ? ?
NB :
Fiddler shows both events (pressing the button && changing index) as a POST
command
What is the structure of the file ? ( psuedo) :
<html >
<head>
...
</head>
<body>
<div id='divOverlay'>
...
</div>
<form id="form1" runat="server" >
<asp:Button runat="server" Text="sssssss"/>
<asp:DropDownList runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged" AutoPostBack="True">
...
</asp:DropDownList>
</form>
<script type="text/javascript">
$(function()
{
$("form").submit(function (e)
{
$('#divOverlay').show();
});
});
</script>
</body>
</html>
Can you show the difference between both requests which sent to the server ? **Yes.**
The right side is when index is changed and the left pane is for button press