是你的<input type="text" onfocus="setday(this)">&nbsp;&nbsp;一般焦点用法<p>
错误。
改成<input type="text" onfocus="setday(this.value)">&nbsp;&nbsp;一般焦点用法<p>

解决方案 »

  1.   

    如果你给这个文本框赋一个日期,直接
    <input type="text" value="<%=new Date()%>">就可以了,,还需要js去写吗?你最好把你的setDay function贴出来,这样才能更好的解决问题。。
      

  2.   

    不行啊。。改成<input type="text" onfocus="setday(this.value)"> 还是缺少对象错误。
    这个文本框我只是试那个日期控件其实有一个formbean 
    public Date getProDate() {
    return proDate;
    }
    public void setProDate(Date proDate) {
    this.proDate = proDate;
    }
    jsp我本来写的是<html:text property="proDate"/>
    但是不行。我是想让formbean 的proDate 接受一个日期型的值。。
      

  3.   

    但为什么我用js结合struts 执行后说js错误。
    但我在ie上查看源文件。把内容拷出来。生成的html文件却能正常运行。。这点想不通
      

  4.   

    你的js脚本setDay函数贴出来。
      

  5.   

    就是用的梅花雨日历控件2.0  
    http://hazeline.vip.sina.com/calendar.htm
      

  6.   

    他的setDay方法有两个参数,你的只有一个啊。