2017-01-23 9 views
0

jquery 단계 플러그인의 양식으로 작업 중이며 다음과 같은 작업을 수행하려고합니다. 완전한 양식이있어서 표시하고 싶습니다. 단계 또는 다른 질문에 대한 초기 응답에 따라.초기 응답 (Jquery 단계)에 따라 양식 단계를 표시하는 방법

초기 질문은 다음과 같이이다 : 나는 내가 할 양식의 단계의 요소를 삭제하는 스크립트를 만들려고

<form id="form" enctype="multipart/form-data" method="POST" class="wizard-big"> 

    <h1>Applicant details</h1> 
    <fieldset> 
<!--.........--> 
    </fieldset> 
    <h1 class="option_no">Owner's data</h1> 
    <fieldset class="option_no"> 
<!--.........--> 
    </fielset> 
</form> 

:

<div id="initial_question" style=" z-index: 10000;text-align: center; padding-top: 200px;position: fixed; top: 0%;left: 0%;right: 0%;bottom: 0%; background-color: rgba(178,139,8,1)"> 
      <div class="middle-box text-center animated fadeInDown"> 

       <h3 class="font-bold">¿question?</h3> 

       <div > 

        <a id="yes"class="btn btn-primary m-t">yes</a> 
        <a id="not" class="btn btn-primary m-t">not</a> 
       </div> 
      </div> 
     </div> 

내 양식이 같다 보여주고 싶지 않지만 작동시키지 않습니다.

<script> 

     $(document).ready(function(){ 


      $("#yes").click(function() { 
      $("#initial_question").fadeOut("slow"); 
      }); 


      $("#not").click(function() { 

      $(".option_no").remove(); 

      $("#initial_question").fadeOut("slow"); 

      }); 
} 
</script> 

PS를 : 아마 전체 양식을 넣어하지 않는 오타 오류를 가지고 있지만, 본질적으로 내 문제를 예시 할 필요가 무엇을하는 스크립트는 다음과 같습니다.

답변

0

스위치/사례 명세서를 보았습니까?

switch (n) { 
case label1: 
// code to execute if answer is yes; 
break; 

case label2: 
// code to execute if answer is no; 
break; 
default: 
echo "Please choose yes or no"; 
break; 
} 
+0

문제는 각각의 경우에 실행할 코드입니다. 코드가 내 코드와 동일한 목표를 충족시킵니다. – Mvram