2013-01-22 68 views
-1

我有一個按鈕的功能預覽和此代碼適用於所有版本的IE在IE7中較少。與IE7的按鈕不起作用。爲什麼?我該如何解決這個問題?按鈕返回不工作在IE7

<?php  
//////// --- BUTTON BACK : CHARGE THE QUERY OF BEFORE PAGE WHEN WE PRESS BACK ---/////////////  

if (isset($_POST['back'])){  

    $_SESSION['onpage']=$_SESSION['onpage']-1; 

    $query_questionset= "select Q.Constructor AS Constructor, 
          QS.QuestionIDFKPK AS QuestionIDFKPK, 
          Q.QuestionValue AS QuestionValue, 
          QS.SortOrder AS SortOrder, 
          QS.onpage AS onpage 
         from tbluserset AS US 
         inner join tblquestionset AS QS ON 
           US.QuestionSetIDFKPK = QS.QuestionSetIDPK 
         inner join tblquestion AS Q ON 
           QS.QuestionIDFKPK = Q.QuestionIDPK 
         where (US.UserIDFKPK = ".$UserId.") 
         and (US.UserSetIDPK= '".$_SESSION['UserSetIDPK']."') 
         and (QS.onpage = '".$_SESSION['onpage']."') 
         order by QS.SortOrder"; 

    if($_SESSION['onpage']==0){   
     $_SESSION['controluserupdate']=1; 

    }//<-END CASE ONPAGE=0 
}//<- END POST [BACK] 

?>  

<script>  
function postBack() {  
        var myForm = document.getElementById("formID"); 
        var backInput = document.createElement("input"); 
        backInput.type = "hidden"; 
        backInput.name = "back"; 
        backInput.value = "1"; 
        myForm.appendChild(backInput); 
}; 
</script> 

< html> 
.. 
.... 
< form id= "formID" name="formID" class="formular" method="post" action= "<?= $url = "QUESTIONAREFINISHING.php"; ?>" accept-charset="utf-8"> 


<div id="footer"> <!-- DIV FOOTER CONTAINER BUTTONS OUTSIDE BOX QUESTIONAIRE--> 
    <?php if($_SESSION['onpage'] >=1 && $_SESSION['onpage'] <= $_SESSION['MaxOnPage']-1){ ?>   
     <div><button class="botonesform" type="hidden" onclick="postBack()" name="back" value="" > &#8592 Back </button ></div>    
     <input class="botonesform" type="submit" name="submit" onclick="probandosubmit()" value="Forward &#8594" />   
    <?php } ?> 

</div> 
</form> 
.. 
.. 
</html> 

回答

-1

對不起,沒有看到完整的代碼。

您發佈應在IE7中工作的JavaScript代碼,所以它可能是其他代碼

你能不能改變:

<input class="botonesform" type="submit" name="submit" onclick="probandosu... 

<input class="botonesform" type="button" name="submit" onclick="probandosu... 

(更改類型從提交按鈕) 。 然後在單擊它時查看IE7中是否存在任何腳本錯誤。如果沒有,那麼嘗試在probandosubmit()中提交表單,看看是否解決了這個問題。我看不到後退按鈕提交任何內容,它只是試圖添加一個隱藏的文本輸入,這應該在IE7中工作