Server IP : 162.240.98.243 / Your IP : 3.147.27.131 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/www/login.easenup.in/ |
Upload File : |
<?php session_start(); require_once('../DBManager.php'); require_once('../LoginManager.php'); include 'header.php'; include("dbconnection.php"); include 'dashboarddocument.php'; ?> <style> .center { border: 1px solid grey; text-align:; } .center2 { border: 5px solid grey; text-align:; } </style> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class='center'> <form action="st_regiaction.php" method="POST"> <table id='example2' class='table table-bordered table-hover'> <tr> <th>Name </th> <th>State </th> <th>City </th> </tr> <tr> <td><input type='text' name='name[]'> </td> <td><input type='text' name='state[]'></td> <td><input type='text' name='city[]'></td> </tr> </table> <input type="submit" value="Submit"> </form> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Add / Remove Table Rows Dynamically</title> <style> form{ margin: 20px 0; } form input, button{ padding: 5px; } table{ width: 100%; margin-bottom: 20px; border-collapse: collapse; } table, th, td{ border: 1px solid #cdcdcd; } table th, table td{ padding: 10px; text-align: left; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $(".add-row").click(function(){ var name = $("#name").val(); var email = $("#email").val(); var markup = "<tr><td><input type='checkbox' name='record'></td><td>" + name + "</td><td>" + email + "</td></tr>"; $("table tbody").append(markup); }); // Find and remove selected table rows $(".delete-row").click(function(){ $("table tbody").find('input[name="record"]').each(function(){ if($(this).is(":checked")){ $(this).parents("tr").remove(); } }); }); }); </script> </head> <body> <form> <input type="text" id="name" name='name[]' placeholder="Name"> <input type="text" id="email" name='state[]' placeholder="Email Address"> <input type="button" class="add-row" value="Add Row"> </form> <table> <thead> <tr> <th>Select</th> <th>Name</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" name="record"></td> <td>Peter Parker</td> <td>peterparker@mail.com</td> </tr> </tbody> </table> <button type="button" class="delete-row">Delete Row</button> </body> </html>