2016-08-20 3 views
0
<?php 
$result_username=mysqli_query($dbc, $query_fetch_username); 


     if(mysqli_num_rows($result_username)){ 

      echo "There is already a user with that username!"; 

      return; 

     } 
//Section of php code that echo the request; 

?> 

<script> 
function processBack(x){ 


_("phase1").style.display="block"; 
_("show_all_data").style.display="none"; 
_("progressBar").value=0; 
_("status").innerHTML="Applicant's Information"; 


    } 
//That's the code for the back button; 
</script> 

<script> 
$(function(){ 
$(document).on("click", ".reg", function(e) { 
e.preventDefault(); 
{  
//This is the ajax that will capture all the inputs from the form 
var infom = $("#msform").serialize(); 
     //$("#showresult").addClass('loader');     
     $.ajax({    
      beforeSend: function() { },   
      type: "POST", 
      url: "http://localhost/registration_sub.php", 
      data:infom,   
      success: function(result){  
      //$("#showresult").removeClass('loader'); 
      $('#showresult').html(result); 
      } 
     });  
     e.preventDefault(); 
} 
}); 
}); 
</script> 

を押したとき、私はステップ1とステップ2の2つのステップを持っている多相フォームを作成したJavaScriptコードはいくつかのPHP &を持っているを解放します。 何か間違って入力したり、入力フィールドを空白のままにしておくと、step2にエラーメッセージが表示されます。その問題を修正して修正し、次に同じメッセージを表示し続けます。問題を選択して修正し、次に[次へ]を押すと、メッセージを消去するにはどうすればよいですか?は、多相フォーム上のPHPエコーメッセージバック

答えて

0
<script type="text/javascript"> 

    $(document).ready(function(){ 
     $('#reset').click(function(){ 

document.getElementById("showresult").style.display="none"; 
    }); 
     }); 
$(document).ready(function(){ 
     $('.reg').click(function(){ 

document.getElementById("showresult").style.display="block"; 
    }); 
     }); 

</script> 

私はそれが他の人に役立つことを願って上記のコードを使用しています。