After submit it should display the same selected form
Everything is working fine,,the problem is after submitting the form it is clearing the complete page and we have to select the radio button again,I don't want this, I need it should stay on the same page by refreshing the form since radio buttons are in one form and product details are in another form.
<div id="myTabContent" class="tab-content fancyTabContent" aria-live="polite">
<div class="tab-pane fade active in" id="tabBody0" role="tabpanel" aria-labelledby="tab0" aria-hidden="false" tabindex="0">
<div>
<div class="row">
<div class="col-md-12">
<div align="center" style="background-color:#B4B4B4;color:white;font-size:20px;height:5%">
<form action=" " method="POST">
<label>
<input value="credit" type="radio" name="formselector" onclick="displayForm(this)" <?php if (isset($_POST['formselector']) && $_POST['formselector']=="credit") echo "checked";?> >Credit</label>
<label><input value="debit" type="radio" name="formselector" onclick="displayForm(this)" <?php if (isset($_POST['formselector']) && $_POST['formselector']=="debit") echo "checked";?> >Debit</label></form>
</div>
<div style="display:none; position:relative" id="credit">
<form class="well form-horizontal" action=" " method="POST" id="credit_form">
<fieldset>
<!--THIS IS THE FORM-->
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4">
<button type="submit" class="btn btn-warning" name="CREDITSUBMIT" value="CREDITSUBMIT">SUBMIT <span class="glyphicon glyphicon-send"></span>
</button>
</div>
</div>
PHP:
if(isset($_POST['CREDITSUBMIT'])) { $POINSERT1 = mysql_query("INSERT INTO CREDIT_PO (PO_NUM,PO_DATE,COMPANY,MATERIAL_QUANTITY,TOTAL_AMOUNT,ADVANCE_AMOUNT,REM_BAL_AMOUNT,EXP_DATE,PLACE_OF_DELIVERY,CUST_NAME,ISSUED_BY,STATUS) VALUES ('$_POST[PO_NUM]','$_POST[PO_DATE]','$_POST[COMPANY]','$_POST[MATERIAL_QUANTITY]','$_POST[TOTAL_AMOUNT]','$_POST[ADVANCE_AMOUNT]','$_POST[REM_BAL_AMOUNT]','$_POST[EXP_DATE]','$_POST[PLACE_OF_DELIVERY]','$_POST[CUST_NAME]','$_POST[ISSUED_BY]','$_POST[STATUS]')");
echo "INSERTED SUCCESSFULLY ";}