php

在表单中<input name="" type="submit" class="sumbit_btn fl" value=""/>
              <input name="" type="button" class="sumbit_btn back_btn fr" value=""/>
怎样在控制器中加载该视图是使<input name="" type="button" class="sumbit_btn back_btn fr" value=""/>能够跳转到原页面

解决方案 »

  1.   

    <input name="" type="button" class="sumbit_btn back_btn fr" value="" onclick="window.history.go(-1);"/>
      

  2.   

    可以有多种方法吧:例如刷新当前页
    <input name="" type="button" class="sumbit_btn back_btn fr" value="" onclick="window.location.href=window.location.href"/>或者用document设置为空值。
    <input name="" type="button" class="sumbit_btn back_btn fr" value="" onclick="resetform()"/>
    <script type="text/javascript">
    function resetform(){
     document.getElementById("id").value = '';
    }
      

  3.   

    你的目的是恢复原值,你看看这个效果吧,不需要跳来跳去,烦不烦....<div id="wp">
        <input type="text" name="yourname" value="" />
        <input type="text" name="email" value="email" />
    </div>
    <script type="text/javascript">function init_input(id){
        var inp = document.getElementById(id).getElementsByTagName('input');
        for(var i = 0; i < inp.length; i++) {
            if(inp[i].type == 'text') {
                inp[i].setAttribute("rel",inp[i].defaultValue)
                inp[i].onfocus = function() {
                    if(this.value == this.getAttribute("rel")) {
                        this.value = "";
                    } else {
                        this.select();
                    }
                }
                inp[i].onblur = function() {
                    if(this.value == "") {
                        this.value = this.getAttribute("rel");
                    }
                }
            }
        }
    }
    init_input("wp");
    </script>