Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem: Only the first instruction is executed

Status
Not open for further replies.

paradisewolf

Programmer
Mar 15, 2007
17
GB
Why this function executes the first intruction but not the second one ?

If I invert their order, again only the first one 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>
 
Hi ninjadeathmonkey

They are 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>
 
When you view the source, after the page is run (not in Visual Studio), are the button and label ID's still the same. ASP.NET can change the ID's when it loads them.

Ron Wheeler
 
One possible reason only the first line is executeed is because the elements with those IDs don't actually exist, and so a JS error is being thrown (thus stopping execution of the code).

As Ron says, you'll have to post the real client-side code for us to know more.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top