亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: onlick if else 的問題 [打印本頁]

作者: zfwslf    時(shí)間: 2011-12-24 01:08
標(biāo)題: onlick if else 的問題
  1. <script type="text/Javascript">
  2. function update_change()
  3. {
  4.          update=document.getElementById('update').value;
  5.          week_date = new Date();
  6.         day = week_date.getDay();
  7.         if (day == "0")
  8.         {
  9.                 day = 7 ;
  10.         }
  11.         month_day = week_date.getDate();
  12.         // now_str = week_date.getFullYear()+"-"+ (week_date.getMonth()+1)+"-"+week_date.getDate();
  13.         differ = 7 - day + 1;
  14.         
  15.          endtime = new Date();

  16.         arr = update.split("-");
  17.         update_format = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],'0','0','0'));
  18.         now_format = new Date(Date.UTC(week_date.getFullYear(),(week_date.getMonth()),week_date.getDate(),'0','0','0'));
  19.         
  20.         update_format = (update_format.getTime()/1000);
  21.         endtime_format = (now_format.getTime()/1000+differ*24*60*60);
  22.         //alert(endtime_format);
  23.         //alert("end "+endtime_format+" upd "+update_format);
  24.         if (update_format >= endtime_format)
  25.         {      
  26.                 plan = "是";
  27.                  sl_plan_obj = document.getElementById('select_isplan');
  28.                 sl_plan_obj.options.length=0;
  29.                 sl_plan_obj.options.add(new Option(plan,"value"));
  30.                                 alert("是")
  31.         }
  32.         else
  33.         {
  34.                 plan = "否";
  35.                 sl_plan_obj = document.getElementById('select_isplan');
  36.                 sl_plan_opbj.options.length=0;
  37.                 sl_plan_obj.options.add(new Option(plan,"value"));
  38.                 alert("否");
  39.         }
  40.         
  41. }
  42. </script>

  43. <td height="28" >變更日期:
  44. <input class="update" name="update" type="text" id="update" >
  45. <font color="#FF0000">*</font>
  46. <input type="button" id="time_sure" name="time_sure" value="確定" onclick="update_change();"> </td>
  47. <td height="28" ><label>是否計(jì)劃:
  48. <select class="sl_normal"  name="select_isplan" id="select_isplan">
  49.               <option>是</option>
  50.               <option>否</option>
  51.           </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