你的form是form名吗?
month是month的文本框名吗?
这些一定要搞正确!

解决方案 »

  1.   

    var是什么???类型吗???应该没这类型!
    Date nowdate = new Date().getDate();
    int month = nowdate.getMonth() + 1;
    if(form.month.value这也要是个int型的,不是就转换<month)
    {
       alert("请选择正确的价格行情日期!");
       return   false ;
    }
      

  2.   

    javascript中声明变量是用var,这个没有错误,而且根本不需要指定类型,我也觉得错误有可能出现在对象的引用上,你要看看你的form对象的name属性植是什么,填写月份的文本框的name属性是什么,和你在函数里引用的是否匹配,再有,我觉得严格要求的话,函数里if语句下的两句应该在{}内,这样可读性更好。
      

  3.   

    <%
      java.util.Date date = new java.util.Date();
      String currDate = ""+(date.getYear()+1900)+(date.getMonth()+1)+date.getDate();
    %>
    <input type="text" name="rdate" value="">
    <input type="hidden" name="currDate" value="<%=currDate%>">
    <input type="button" name="submit" value="submit" onclick="check()"><script language="JavaScript">
    function check() {
     if (isValidDate(form1.rdate.value) {//判断输入的日期类型是否合法
        var rdate = document.form1.rdate.value;
    var currentdate = document.form1.currDate.value;
    var recievedate = '';
    var i = 0;
    var j = 0;
             //假设输入的日期格式是:1900-1-1或者是:1900-01-01
    while(rdate.indexOf('-') >= 0) {
      j = rdate.indexOf('-');
      recievedate = recievedate + rdate.substring(i,j);
      rdate = rdate.substring(j+1,rdate.length);
    }if (parseInt(recievedate) > parseInt(currentdate)) {
      alert("日期不能大于当前日期!");
    }
      

  4.   

    function Checkdate()
    {
    var now=new date()
    var month=now.getMonth()
    if (form.month.value<month)
    alert("请选择正确的价格行情日期!");
                                                         ^^---这是什么东东?全角的分号?当然说你错啦~
    return false ;
    }
      

  5.   

    改成这样就行了:
    function Checkdate()
    {
    var now=new date()
    var month=now.getMonth()
    if (form.month.value<month)
    alert("请选择正确的价格行情日期!");
    return false ;
    }