Today,I meet a question in my object.The code like this,but I can’t get the input label value that name is publictime.How to solve it?
Method:将disabled 改成 readonly
disabled无法被提交
HTML代码
<input type="text" name="publictime" id="publictime" disabled value="${now }">
JS代码
/**
* 时间的实时更新
*/
var timerID = null
var timerRunning = false
stopclock()
showtime()
function stopclock() {
// cannot directly test timerID on DEC OSF/1 in beta 4.
if (timerRunning)
clearTimeout(timerID)
timerRunning = false
}
function showtime() {
var now = new Date()
now = now.toLocaleString()
$('#publictime').attr("value", now);
timerID = setTimeout("showtime()", 1000)
timerRunning = true
}