Problem: Only the first instruction is executed

Discussion in 'JavaScript' started by paradise_wolf, Apr 5, 2007.

  1. #1
    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>
     
    paradise_wolf, Apr 5, 2007 IP
  2. paradise_wolf

    paradise_wolf Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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>
     
    paradise_wolf, Apr 6, 2007 IP
  3. Adi

    Adi Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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)
     
    Adi, Apr 6, 2007 IP