 
 <div class="container mt-3" style="margin-top:2px;">

 <div  class="mt-4 p-5 bg-white text-dark rounded" >
  <h6>Medical invistigation/procedure registration:</h6> 
     
    <div class="row">
    <div class="col">
       <label for="tname">Name:</label>  
      <input type="text"  style="background-color:white;border-radius:12px; width:100%;" class="form-control" id="tname" style="height:20px;" placeholder="Type name" name="tname" required> 
     <sup class="text-danger" id="in"> </sup>
    
</div>
 <div class="col">
    <label for="tPrice">Cost:</label> 
      <input type="number" style="background-color:white;border-radius:12px; width:100%;" class="form-control" id="tPrice" placeholder="Cost" name="tPrice" required>
     <sup class="text-danger" id="q"> </sup>
  </div>
    
   <div class="col">
    <label for="cat">Category:</label> 
      <select  class="form-control" style="background-color:white;border-radius:12px; width:100%;" id="cat" name="cat" required>
        <option value="">Select</option>
        <option value="Laboratory">Laboratory</option>
        <option value="Radiology">Radiology</option>
        <option value="Procedure">Procedure</option>
      </select>
     <sup class="text-danger" id="ca"> </sup>
  </div>
 
<div class="col-sm justify-content-center">

  <div class="form-floating mb-3 mt-3"> 
  <button type="submit" id="submit" value="Submit" name="submit" class="btn btn-primary" style="height:60px;" onclick="saveData()">Submit</button>

</div>
</div>
</div>

</div>
 </div>
<div class="container mt-3">
<div class="row">
    <div class="col"> 

       <label for="tname">Search for investigation/procedure:</label> 
      <input type="text" style="background-color:white;border-radius:12px; width:100%;" onkeyup ="submision()" class="form-control" id="cname" style="height:20px; width:74%;"  name="cname" required> 
    
    </div>
  </div>
</div>
<div id="dispR">
   <?php
  require_once "mTestList.php";
  ?>
  
</div>
 
 <script>

  function submision(){
    
    var searchValue=$('#cname').val();

  
    $('#dispR').empty();
    $.post('mTestSearch.php',{searchValue:searchValue},function(data){
      $('#dispR').html(data);

    });
  }
 

 
 function saveData(){ 
var ecc=0; 
var tname =document.getElementById('tname').value; 
$.trim(tname);
var cat =document.getElementById('cat').value; 
$.trim(cat);
var submit =document.getElementById('submit').value;

var tPrice =document.getElementById('tPrice').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(cat==""){ 

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

               }
else{

document.getElementById('ca').innerHTML="";
    }
  
if(tPrice==""){ 

         ecc++;
             document.getElementById('q').innerHTML="Quantity is required!..";
 

               }
else{

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

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

               }
else{

document.getElementById('in').innerHTML="";
    }
  
    if(ecc==0)
    { 
        $.post("mTestPro.php",
          {submit:submit,tname:tname,cat:cat,tPrice:tPrice},
          function(data){
      $('#disp').html(data).show();

    });
    }
 
} 
 
 
</script>