【发布时间】:2010-05-01 08:54:12
【问题描述】:
我想在 dojo 时间文本框中添加一个 on blur 事件,但该事件从未运行过 所以timetextbox的声明是这样的:
<label>End</label><input id="endp" name="endp" onBlur="calculateTimeSpent2(startp,endp,output);" />
javascript函数是这样的:
function calculateTimeSpent2(startp,endp,outputp)
{
var tmp0=document.getElementById('startp').value.split(':');
var tmp1=document.getElementById('endp').value.split(':');
如果 (tmp0[0]!='' && tmp1[0]!='') { var val1= findtime(tmp0[0],tmp0[1],tmp1[0],tmp1[1]);
var tmp=val1.split(':');
if (tmp[0].indexOf('-')==-1)
document.getElementById('outputp').value=val1;
else
{
alert ("Start Time must be lower than End Time ");
document.getElementById('endp').focus();
}
} }
我不明白为什么 dojo 在失去焦点时没有正确执行事件。 我试图输入 type=text 但它不起作用。 感谢您的帮助。
【问题讨论】:
标签: dojo