年齢:<html:select property="age"  onchange="displaySelect(this)">
        <html:options collection="options" property="value"            labelProperty="label"/>
      </html:select>如以上代码,当选择年龄后为何不执行displaySelect方法?

解决方案 »

  1.   

    onchange:JavaScript event handler executed when this element loses input focus and its value has changed.
      

  2.   

    struts标签不像html标签一样,可以给每一个标签定义一个name属性,而struts的name属性有其它的作用,其作用和html标签里面的作用是不一样的
    所以,在你的javaScript里面你肯定去获得这个age的值了,这是获取不到的,会提示你说找不到这个对象.因为他不会把property当成你html里面的name