我用的常见的代码

来源:互联网 发布:四级单词一笑而过软件 编辑:程序博客网 时间:2024/05/16 09:38

1、html标签:<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

2、 (1)关于提交:    function doSubmit(operate){
                                       document.forms[0].elements["operate"].value=operate;
                                       document.forms[0].submit();
                              }

      (2) 关于隐藏域:   <html:hidden property="operate" value=""/>

      (3) 关于按钮提交:<html:button property="" value="提交" onclick="doSubmit('doRegister')"></html:button>

3、跳转到修改页面:    <html:text property="student.id" value="${student.id}" readonly="true"></html:text>
                                 <html:text property="student.name" value="${student.name}"></html:text>    

4、弹框:  function doDelStudent(studentId){
                        if(confirm("删除吗?","消息!")){
                        window.location.href="studentAction.do?operate=doDelete&id="+studentId;
                  }
            }

   
 5、超链接: function doUpStudent(studentId){
               window.location.href="studentAction.do?operate=toEdit&id="+studentId;
           } 

      <a href="javascript:doDelStudent(${student.id })">删除</a>

     

原创粉丝点击