亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
onlick if else 的問題
[打印本頁]
作者:
zfwslf
時(shí)間:
2011-12-24 01:08
標(biāo)題:
onlick if else 的問題
<script type="text/Javascript">
function update_change()
{
update=document.getElementById('update').value;
week_date = new Date();
day = week_date.getDay();
if (day == "0")
{
day = 7 ;
}
month_day = week_date.getDate();
// now_str = week_date.getFullYear()+"-"+ (week_date.getMonth()+1)+"-"+week_date.getDate();
differ = 7 - day + 1;
endtime = new Date();
arr = update.split("-");
update_format = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],'0','0','0'));
now_format = new Date(Date.UTC(week_date.getFullYear(),(week_date.getMonth()),week_date.getDate(),'0','0','0'));
update_format = (update_format.getTime()/1000);
endtime_format = (now_format.getTime()/1000+differ*24*60*60);
//alert(endtime_format);
//alert("end "+endtime_format+" upd "+update_format);
if (update_format >= endtime_format)
{
plan = "是";
sl_plan_obj = document.getElementById('select_isplan');
sl_plan_obj.options.length=0;
sl_plan_obj.options.add(new Option(plan,"value"));
alert("是")
}
else
{
plan = "否";
sl_plan_obj = document.getElementById('select_isplan');
sl_plan_opbj.options.length=0;
sl_plan_obj.options.add(new Option(plan,"value"));
alert("否");
}
}
</script>
<td height="28" >變更日期:
<input class="update" name="update" type="text" id="update" >
<font color="#FF0000">*</font>
<input type="button" id="time_sure" name="time_sure" value="確定" onclick="update_change();"> </td>
<td height="28" ><label>是否計(jì)劃:
<select class="sl_normal" name="select_isplan" id="select_isplan">
<option>是</option>
<option>否</option>
</select></label></td>
復(fù)制代碼
當(dāng)我輸入日期 2011-12-28 這樣的形式
option就會(huì)刪除 增加一個(gè)是或者否選項(xiàng)
可是這里我的原因是if 塊里面的會(huì)執(zhí)行 else永遠(yuǎn)都不會(huì)執(zhí)行。。。條件邏輯我測試過是對(duì)的
不知道為什么。。。不知道俺說的清楚清楚。。求各位幫下
作者:
zfwslf
時(shí)間:
2011-12-25 18:14
頂上去- -
作者:
zfwslf
時(shí)間:
2011-12-25 21:57
自己手誤 寫錯(cuò)了個(gè)對(duì)象。。。
歡迎光臨 Chinaunix (http://72891.cn/)
Powered by Discuz! X3.2