<SCRIPT LANGUAGE="JavaScript">
<!--
function myselect(f)
{
if (f.s1.options[f.s1.selectedIndex].text=="按日期") f.t1.valuenew Date().toLocaleString().replace(/ .+/ig,"")
else (f.t1.value="")
}
//-->
</SCRIPT>

解决方案 »

  1.   

    /*****************************************************************
         Name shortDate
         Purpose 取日期类型的短格式  YYYY-MM-DD     Return String
     *****************************************************************/
     Date.prototype.shortDate = function(){
        return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() ;     
     }把 f.t1.value=(new Date()).toLocaleString() 改写为
    f.t1.value=(new Date()).shortDate()  即可
      

  2.   

    请在看看 ZHH309(小可)兄弟的函数,好像不执行阿