aaronjonmartin
Technical User
Hi all, hopefully I can explain this clearly enough. If anyone can shed some light on this i would be very greatful.
I have a javascript countdown timer in one of my .aspx pages which countsdown to a particular date time. The datetime to be counted down to is retrieved from a database. This is how I have attempted this so far:
this script section appears in the body of my html, and i am trying to pass the value by setting the text of the label to the value of the variable which contains the date. Unfortunately this doesnt work as the label generates the following code:
as you can see the label generates the <span> tag which is causing the code to not work correctly.
So how can i get the value of a variable into the javascript section of code?
Thanks for any help in advance.
Aaron
"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
I have a javascript countdown timer in one of my .aspx pages which countsdown to a particular date time. The datetime to be counted down to is retrieved from a database. This is how I have attempted this so far:
Code:
<script language="JavaScript">
TargetDate = "<asp:Label ID="kickofftime" runat="server" Text="Label" />";
BackColor = "none";
ForeColor = "black";
CountActive = true;
CountStepper = -1;
DisplayFormat = "%%D%%d %%H%%h %%M%%m %%S%%s";
FinishMessage = "Games currently in progress";
</script>
this script section appears in the body of my html, and i am trying to pass the value by setting the text of the label to the value of the variable which contains the date. Unfortunately this doesnt work as the label generates the following code:
Code:
<script language="JavaScript">
TargetDate = "<span id="kickofftime">29/04/2006 12:30:00</span>";
BackColor = "none";
ForeColor = "black";
CountActive = true;
CountStepper = -1;
DisplayFormat = "%%D%%d %%H%%h %%M%%m %%S%%s";
FinishMessage = "Games currently in progress";
</script>
as you can see the label generates the <span> tag which is causing the code to not work correctly.
So how can i get the value of a variable into the javascript section of code?
Thanks for any help in advance.
Aaron
"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)