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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nothing displays on page

Status
Not open for further replies.

visualJay

Programmer
Jun 14, 2001
57
US
the time or date does not display on web page what am i doing wrong.

<html>
<head>
<title>Form1</title>
<script language=&quot;JavaScript&quot;><!--

function showHour(thehour){
if(thehour > 0 && thehour < 13){
return(thehour)
}
if(thehour == 0){
return(12)
}
return(thehour-12)
}

function showZero(inValue){
if(inValue > 9){
return(&quot;:&quot; + inValue)
}
return(&quot;:0&quot; + inValue)
}

function showAmPm(){
if(now.getHours() < 12){
return(&quot; am&quot;)
}
return(&quot; pm&quot;)
}

function showTime(){
now = new Date
document.frmcomplaint. showHour(now.getHours()) +
showZero(now.getMinutes()) +
showZero(now.getSeconds())+
showAmPm()
setTimeout(&quot;showTime()&quot;,1000)
}

function dodate(){
days = newArray(&quot;Sunday&quot;,&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;)
months = new Array(&quot;Jan&quot;,&quot;Feb&quot;,&quot;March&quot;,&quot;April&quot;,&quot;May&quot;,&quot;June&quot;,&quot;July&quot;,&quot;Aug&quot;,&quot;Sept&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;)
d = new Date()
dDay = days[d.getDay()]
dMonth = monthd[d.getMonth()]
temp = dDay +&quot;,&quot;+dMonth+&quot;&quot;+d.getDate()+&quot;20&quot; + d.getYear()
document.frmcomplaint. }

//-->
</script>

</head>

<body bgcolor=&quot;000000&quot;>
<center>
<font color=&quot;ffffff&quot;>
<h2>Test page</h2></font>
</center>

<form name=&quot;frmcomplaint&quot;>

<table width=&quot;80%&quot;>
<font color=&quot;ffffff&quot;><tr>
<td align=&quot;right&quot;><b><font color=&quot;ffffff&quot;>Date:&nbsp</b></font></td>
<td><input type=&quot;text&quot; name=&quot; size=&quot;11&quot; value=&quot;&quot;></td></tr>
<tr>
<td align=&quot;right&quot;><b><font color=&quot;ffffff&quot;>Time:&nbsp</b></font></td>
<td><input type=&quot;text&quot; name=&quot; size=&quot;11&quot; value=&quot;&quot;></td></tr>

</form>
</body>
</html>
 
You're not calling any of your functions from any where. No code is being executed. Use an event like <body onload=&quot;aFunctionName()&quot;> to get the ball rolling. Adam
 
Thank you that is the bit i needed. You made my day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top