struts标签 的name,id属性只是改了个名字而已。。当某个下拉列表框改变,某个text框显示或隐藏
你说的这个功能HTML+javascript就可以实现不需要struts

解决方案 »

  1.   

    <DIV id="Error" >
         <B><FONT color=#3366ee>操作结果:</FONT></B><BR><FONT color=red><%=strError%></FONT></DIV>
         <script language="javascript">
      setTimeout("document.getElementById('Error').style.display = 'none';", 8000);//8秒后 Error 这个标签隐藏
      </script>给你一个关于ID使用的简单例子 <input type=button value=编辑 name=mp id=mp onclick=edit(); style="display: none" /> 
    style="display: none" 代表了隐藏这个标签 javascript执行下面的代码可以让他显示,,,
    document.getElementById('mp').style.display = '';还有很多种控制的方法。。
      

  2.   

    http://community.csdn.net/Expert/topic/4843/4843434.xml?temp=.9711573
    谁给我看下啊我这个问题一直没有答复我.我在等待
      

  3.   

    谢谢你的回答,你帮我看看这个该怎么写!
    我给你发段代码
    你看看该怎么写!
    <html:form action="/searchShit">
    <html:select property="timeLike" onchange="show()">
    <html:option key="timeEqual" value="=" />
    <html:option key="timeBig" value=">" />
    <html:option key="timeSmall" value="&lt;" />
    <html:option key="timeBetween"  value="between" />
    </html:select><td>
    <html:text property="timeText" />
    </td>
    <td>
    <html:text property="timeText2"  disabled="disabled"/>
    </td>当下拉列表框选为between时 timeText2的框才显示,其他时间都是隐藏的
    一定要是struts标签!
      

  4.   

    <html:form action="/addResumeAction.do?method=addPersonInfo">
    <td width="183" height="30" valign="bottom"><html:text property="person_name" styleClass="biaokuang" /></td><td width="12%"><html:radio property="sex" value="1" /></td>
     <td width="12%">男</td>
    <td width="15%"><html:radio property="sex" value="2" /></td>
    <td width="61%">女</td>
    </html:form>js操作如下:
    if(document.addResumeForm.person_name.value == ''){
    alert("请填写您的姓名!");
    return false;
    }else if((document.addResumeForm.sex[0].checked == false) && (document.addResumeForm.sex[1].checked == false)){
    alert("请选择您的性别!");
    return false;
    }
    其他标签类推就可以了
      

  5.   

    <html:select style="width:250px" property="exper_addr_name">
                    <html:option value="">--请选择--</html:option>
                    <html:optionsCollection property="schools"
                                      label="label"
                                      value="value"/>                
      </html:select>
    js如下:
     if(addResumeForm.exper_addr_name.options[addResumeForm.exper_addr_name.selectedIndex].value == ''){
        alert("请选择学校!");
        return false;
       }else{
         form.action="/user/addResumeAction.do?addEducation";
     form.method.value="addEducation";
     form.submit();
    }
      

  6.   

    你的意思,form的名字就是用actionForm的名字吗?我试试,谢谢!
    多问句怎么给分,是不是把那个分数添了,然后点删除就可以?
      

  7.   

    看的不是很明白!!
    addResumeForm具体是冲哪得来的啊,
    我不太清楚
    俺是菜菜菜鸟,还请高手明间,
      

  8.   

    <form-bean name="addResumeForm" type="com.rmzp.user.forms.AddResumeForm" /> <action attribute="addResumeForm" name="addResumeForm" path="/addResumeAction" type="org.springframework.web.struts.DelegatingActionProxy" parameter="method" scope="request">是在struts-config.xml文件中配置的对应action的form名
      

  9.   

    在问个问题,当<html:checkbox> 没有checked属性
    那怎么设置啊,我要判断,如果有这个权限
    <html:checkbox>就checked然后再打印到页面
    可我怎么把checked放到<html:checkbox>里呢?
      

  10.   

    不是很明白你的意思,我想你可以在form里给对应的<html:checkbox>进行set相应的值就可以了
      

  11.   

    document.forms.checkboxForm.action="/checkbox.do?id=1";
    还有,<html:radio property="checkbox" onclick="oncli()" value="18">radio4</html:radio>
    function oncli(object_1){document.forms.checkboxForm.action="/checkbox.do?id=1";//document.forms[0].action="../checkbox.do?name=1"; 
    document.forms[0].submit(); 
    }
    JS里除了document.forms[0].submit();好使,那俩都不好使
    我的form名是checkboxForm
    <action
          attribute="checkboxForm"
          input="/form/checkbox.jsp"
          name="checkboxForm"
          path="/checkbox"
          scope="request"
          type="com.aJetFile.struts.action.CheckboxAction">
          <forward name="checkbox" path="/form/checkbox.jsp" />
        </action><form-bean name="checkboxForm" type="org.apache.struts.action.DynaActionForm" >
         <form-property name="checkbox" type="java.lang.String"></form-property>
         <form-property name="ch" type="java.lang.String"></form-property>
        </form-bean>
      

  12.   

    谢谢你哈moonfork(king)
    这回知道咋回事啊,原来property就是名字啊,
    封贴
    散分