Server IP : 162.240.98.243 / Your IP : 3.12.123.189 Web Server : Apache System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : btiyawmy ( 1003) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/btiyawmy/public_html/login.easenup.in/ |
Upload File : |
<html> <head> <title>Onclick increase Table Rows</title> <script type="text/javascript"> function addRows(){ var table = document.getElementById('emptbl'); var rowCount = table.rows.length; var cellCount = table.rows[0].cells.length; var row = table.insertRow(rowCount); for(var i =0; i <= cellCount; i++){ var cell = 'cell'+i; cell = row.insertCell(i); var copycel = document.getElementById('col'+i).innerHTML; cell.innerHTML=copycel; if(i == 4){ var radioinput = document.getElementById('col4').getElementsByTagName('select'); for(var j = 0; j <= select.length; j++) { if(select[j].type == 'text') { var rownum = rowCount; select[j].name = 'gender['+rownum+']'; } } } } } function deleteRows(){ var table = document.getElementById('emptbl'); var rowCount = table.rows.length; if(rowCount > '2'){ var row = table.deleteRow(rowCount-1); rowCount--; } else{ alert('There should be atleast one row'); } } </script> </head> <body> <form action="#" method="post"> <div class="table-responsive"> <table class="remove-items" id="emptbl"> <tr> <td></td> <td> <b>Types of <Br>Investigations</b></td> <td><b>Select Investigation</b></td> <td><b>Body Part</b></td> <td><b>Request Investigation</b></td> <td><b>Priority slip</b></td> </tr> <?php $sql1 ="SELECT * FROM patient WHERE patientid='$_GET[patientid]'"; $qsql1 = mysqli_query($con,$sql1); while($rspi1 = mysqli_fetch_array($qsql1)) { echo" <input type='hidden' name='prescriptionid[]' value='$_GET[prescriptionid]'> <input type='hidden' name='patientid[]' value='$_GET[patientid]'> "; } ?> <tr> <td id="col0"><input type="checkbox" name="empname[]" value="" /></td> <td id="col1"> <select onchange="ivtype(this.value)" class="form-control" id='requesttestid[]' name="requesttestid[]"> <option value="44">Radiology</option> <option value="45">Pathology</option> </select></td> <td id="col2"><div id='divmedidr'><input type="text" name="phone[]" value="" /></div></td> <td id="col3"> <div id='divdr'> <select name="department[]" id="dept"> <option value="0">Select Department</option> <option value="1">Sales</option> <option value="2">IT</option> <option value="3">Warehouse</option> </select> </div> </td> <td id="col4"> <input type="radio" name="gender[0]" value="male" />Male <input type="radio" name="gender[1]" value="female" />Female </td> </tr> </table> <p align='right'><input type="button" value="Add Row" onclick="addRows()" /></p> <table> <tr> <td><input type="submit" value="Submit" /></td> </tr> </table> <input type='button' value='Remove Items' class="button"></p> </form> </div> <script>$(".button").on("click", function() { $('input:checked').not('.all').parents("tr").remove(); }); $('.all').on('click',function(){ var $inputs = $('table').find('input'); $inputs.prop('checked', 'checked'); });</script> <script> function ivload(drid) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("divdr").innerHTML = this.responseText; } }; xmlhttp.open("GET","loadiv.php?drid="+drid,true); xmlhttp.send(); } </script> <script> function boddyload(bodyid) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("divbody").innerHTML = this.responseText; } }; xmlhttp.open("GET","loadbodyiv.php?bodyid="+bodyid,true); xmlhttp.send(); } </script> <script> function ivtype(ivtypeid) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("divmedidr").innerHTML = this.responseText; } }; xmlhttp.open("GET","loadivtype.php?ivtypeid="+ivtypeid,true); xmlhttp.send(); } </script> </body> </html>