title: How to return post form value and action after perform onclick function in php?
body: <p>In this code I am simply do <code>if($("#teacherID").val()=='0')</code> then it show alert which is working fine but after change value of <code>$("#teacherID").val()</code> then it not return to form action. So, How can I do this? Please help me.</p>
  
  <pre><code>&lt;script&gt;
      $(".paypay").click(function(e){
          e.preventDefault();
          if($("#teacherID").val()=='0')
          {
              alert("Please select academic partner!");
          }
      });
  &lt;/script&gt;   
  &lt;form action="&lt;?php echo base_url() ?&gt;mymain/xyz" onsubmit="return confirm('Do you really want to submit the form?');" method = "post"&gt;               
      &lt;label class="nexCheckbox"&gt;Check
          &lt;input type="checkbox" name="select_all" id="select_all"&gt;
          &lt;span class="checkmark checkmark-action-layout"&gt;&lt;/span&gt;
      &lt;/label&gt;
  
      &lt;input type="submit" class="btn btn-primary etsfilertButton disabled paypay" name="Pay" value="Pay" disabled&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>Thank You</p>