Hi Sir,
Im just new in programming using javascript and php.Please help me. I have a problem here..Im doing a system using php and its important to have date and digital time inside a textbox whenever the page loads, so I used javascript to do that. The problem is i dont know how to call and save the value of the textbox. Can somebody help me..Thank You in Advance..
Here's the code..
<html>
<head>
<link rel = "stylesheet" href = "../study/style.css" type = "text/css">
<title>Free SMS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="main">
<table width="100%" border="0" class="forumline">
<tr>
<td width="17%">Start Date/Time:</td>
<td width="33%"><input type="text" name="start">
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<script>
function show2(){
var digital=new Date()
var month = digital.getMonth()
var dom = digital.getDate()
var year = digital.getYear()
var hours = digital.getHours()
var minutes=digital.getMinutes()
var seconds=digital.getSeconds()
var moy = new Array("01","02","03","04","05","06","07","08","09" ,"10","11","12")
year = (year+"").substring(2,4)
if (hours > 24){
// dn = "PM";
hours = hours -24;}
if (hours==0){
hours = 24;}
if (minutes<=9){ minutes = "0" + minutes}
if (seconds<=9){ seconds = "0" + seconds}
document.main.start2.value=moy[month]+"/" + dom + "/" +year+ " " + hours + ":" + minutes + ":" + seconds;
// document.main.clear.value =moy[month]+"/" + dom + "/" + year + " " + hours + ":" + minutes + ":" + seconds;
setTimeout("show2()",1000);
}
show2()
//-->
</script>
</body>
</html>