Why this function executes the first intruction but not the second one ? If I invert their order, again only the one that is the first in the order is executed and the second one don’t. What am I missing here ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <script language="javascript" type="text/javascript"> function ChangeThem() { document.getElementById('DownlFile').value = 'Next'; document.getElementById('WarnLb').style.visibility = 'visible'; } </script>
The javascript instructions are related to asp.net web controls. Here is the code: ~~~~~~~~~~~~~~~~~~~~~~~~~ <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Click the Button to Start Download"></asp:Label> <br /> <br /> <asp:Button ID="DownlFile" runat="server" Text="Download The File" OnClick="DownlFile_Click" OnClientClick="Hide()" /> <br /> <br /> <asp:Label ID="WarnLb" runat="server" Text="After Clicking the Button Wait Until the Download Dialog Appears"></asp:Label> <br /> <br /> <asp:Label ID="Label2" runat="server" Text=""></asp:Label> <br /> <br /> <asp:Label ID="Label3" runat="server" Text=""></asp:Label> </div> </form> </body>
You probably have a problem with one of the getElementById() functions - verify that you don't get null value from it. (For debug you can use alerts or wrap everything in try cache block and then display the exception message with alert)