如果一个按钮定义了两个onclick 的函数,是否能够两个都执行?

解决方案 »

  1.   

    Date.parse必须用月/日/年的格式来表示,例如"7/20/96";
    d1 = Date.parse(d.replace(("-","/")); // 转换为日期对象 <---写错了,括号多了,
    我再看看。
      

  2.   

    Date.parse不是转换时间的函数嘛。
    d.replace也不能这么用,你想实现
    一个什么功能噢?
      

  3.   

    function CheckDate(Obj)
    {
    datestring=Obj;
    execScript("mmyy=isdate(datestring)","vbscript");
    if (mmyy) 
    {
    execScript("ss_sub=datediff('s',now(),cdate(datestring))","vbscript")
    if (ss_sub>0)
    {
    alert("居然现在都还没到这个时刻!写特");
    return false;
    }
    }
    else
    {
    alert ("日期格式不对");
    return false;
    }
    return true;
    }
      

  4.   

    execScript("vbscript语句","vbscript")上面的datestring=Obj; 改成datestring=Obj.value; 就OK了
    我试过用JS比较输入的日期与当前日期,但只在月-日-年格式下通过,如果输入值为年-月-日,Date.parse(d1)的值就会为空,无法比较的了。。
    if (mmyy) 
    {
    d1=new Date();
    d1=datestring;
    d2=new Date();
    //alert(Date.parse(d1)+"mm"+Date.parse(d2));
    if (Date.parse(d1)>Date.parse(d2)) 
      {
      alert("居然现在都还没到这个时刻!");
      return false;
      }