javascript - submitting popup div without refreshing the parent page -


i have parent page main.php running using ajax. in page click on image opening popup div using jquery.in popup div data entered , need save data in database . while doing , using button submits form, because of parent page getting refreshed. how avoid this...

      /*main.php */         <form id="popform">        <input type="hidden" id="hdnsubmt">       <div id="popup">          <input type="text" id="text1"  name="text1" value=" ">          <input type="button" value="submit" id="btnsubmit" onclick="submitform();">       </div>        </input>      </form>      <script>          $(document).ready(function(){           $('#popup').hide();           $( "#image1" ).click(function() {                   $('#popup').show(); //if image clicked pop appears                          });        });        function submitform()         {             document.popform.submit();          }      </script>       <?php            if (isset('hdnsubmit'))           {            // save data database;            }        ?> 

i need submit pop-up div without refreshing main page , using ajax in main page,so need avoid ajax in case.. please help..

<form id="popform" action="" method="post">

now form content on same page inside <?php ?>

example

<?php   echo $name1=$_post['name1'];  ?> 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -