Hello, I am trying to call a javascript from a asp button but I am not getting any results, here is my code:
On Page_Load I have:
What is wrong?
Thanks,
Louis
Code:
<head runat="server">
<title>Untitled Page</title>
<script language="javascript">
var msec=0
var sec=0
var min=0
var hrr=0
function start()
{
document.forms[0].display.value=hrr+":"+min+":"+sec
go=setTimeout("start()",1)
msec++
if(msec==100)
{
msec=0
sec++
}
if(sec==60)
{
sec=0
min++
}
if(min==60)
{
min=0
hrr++
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="btnOK" runat="server" Text="OK" Width="50px" />
</form>
</body>
On Page_Load I have:
Code:
protected void Page_Load(object sender, EventArgs e)
{
btnOK.Attributes.Add("onClick", "return start();");
}
What is wrong?
Thanks,
Louis