 
 
 <div class="container mt-3" style="width:100%;">
<div id="disR"></div>
 <div  class="mt-4 p-5 bg-white text-dark rounded">
  <h6>Item registration:</h6> 
     
    <div class="row">
    <div class="col" >
      <label for="iname">Name:</label>  
      <input type="text" class="form-control" id="iname" style="width:100%; height:35px; border-radius:12px; " placeholder="Item name" name="iname" required>
      <sup class="text-danger" id="in"> </sup>
    </div>
     
    <div class="col" >
      <label for="icat">Category:</label>  
      <input type="text" class="form-control" id="icat" style="width:100%; height:35px; border-radius:12px; " placeholder="Category" name="icat" required>
      <sup class="text-danger" id="ic"> </sup>
    </div>
    
  
   
 <div class="col" >
      <label for="ipprice">Purchase:</label>  
      <input type="number" class="form-control" id="ipprice" style="width:100%; height:35px; border-radius:12px; " placeholder="Purchase price" name="ipprice" required>
      <sup class="text-danger" id="ip"> </sup>
    </div>
 </div>
<div class="row">
<div class="col" >
      <label for="isprice">Sales:</label>  
      <input type="number" class="form-control" id="isprice" style="width:100%; height:35px; border-radius:12px; " placeholder="Sales price" name="isprice" required>
      <sup class="text-danger" id="is"> </sup>
    </div>
    <div class="col"> 
      <label for="iQty">Qty:</label> 
      <input style="width:100%; height:35px; border-radius:12px;"  type="number" class="form-control"   id="iQty" placeholder="Item Qty" name="iQty" required>
     <sup class="text-danger" id="q"> </sup>
    </div>
     <div class="col"> 
      <label for="expd">Expired:</label> 
      <input style="width:100%; height:35px; border-radius:12px;"  type="date" class="form-control"   id="expd" placeholder="Expired" name="expd" required>
     <sup class="text-danger" id="ex"> </sup>
    </div>
    </div>
  <table class="table" border="0"><tr>
  <td> 
      <label for="wsprice">Whole sell:</label>  
      <input type="number" class="form-control" id="wsprice" style="width:100%; height:35px; border-radius:12px; " placeholder="Whole sells" name="wsprice" required>
      <sup class="text-danger" id="ws"> </sup>
      

  </td>
  <td width="80%" align="right"> 
   
  <button type="submit" class="btn btn-primary" id="submit" value="Submit" name="submit"  style="height:60px;" onclick="saveData()">Submit</button>
</td>
</tr>
</table>
 
</div>

<!-- SEARCH BOX END-->

</div>

 </div>
  
<script>

function saveData(){ 
var ecc=0;
var sdate =document.getElementById('sdate').value; 

var user =document.getElementById('user').value; 
$.trim(user);
var iname =document.getElementById('iname').value; 
$.trim(iname);
var icat =document.getElementById('icat').value; 
$.trim(icat);
var ipprice =document.getElementById('ipprice').value; 
$.trim(ipprice);
var wsprice =document.getElementById('wsprice').value; 
$.trim(wsprice);
var isprice =document.getElementById('isprice').value; 
$.trim(isprice);
var expd =document.getElementById('expd').value; 
$.trim(expd);
var iQty =document.getElementById('iQty').value; 
 
var submit =document.getElementById('submit').value; 
var vN =/[\(A-Za-z)]/g; 

var nV =/[a-z\s]/i;
var j=0,k=0, g=0,i=0;

  //FIRST NAME VALIDATION
   if(sdate==""){ 

         ecc++;
         alert("Date is required!..");

            }
             if(user==""){ 

         ecc++;
         alert("Username is required!..");

            }
 
  if(icat==""){ 

         ecc++;
         document.getElementById('ic').innerHTML="Category is required!..";

            }
else{
document.getElementById('ic').innerHTML="";
    }
if(wsprice==""){ 

         ecc++;
         document.getElementById('ws').innerHTML="Whole sell price is required!..";

            }
else{
document.getElementById('ws').innerHTML="";
    }
if(ipprice==""){ 

         ecc++;
         document.getElementById('ip').innerHTML="Purchase price is required!..";

            }
else{
document.getElementById('ip').innerHTML="";
    }
if(isprice==""){ 

         ecc++;
         document.getElementById('is').innerHTML="Sales price is required!..";

            }
else{
document.getElementById('is').innerHTML="";
    }
if(expd==""){ 

         ecc++;
         document.getElementById('ex').innerHTML="Expire date is required!..";

            }
else{
document.getElementById('ex').innerHTML="";
    }
if(iQty==""){ 
         ecc++;
         document.getElementById('q').innerHTML="Quantity is required!..";

            }
else{
document.getElementById('q').innerHTML="";
    }
     
if(iname==""){ 

         ecc++;
         document.getElementById('in').innerHTML="Item name is required!..";

             }
else{

document.getElementById('in').innerHTML="";
    }
  
    if(ecc==0)
    { 
        $.post("storeRgFPro.php",
          {submit:submit,user:user,sdate:sdate,iname:iname,wsprice:wsprice,iQty:iQty,expd:expd,icat:icat,isprice:isprice,ipprice:ipprice},
          function(data){
      $('#disR').html(data).show();

    });
    }
 
} 
 
 
</script>
 