Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
- <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
- <script>
- $( function() {
- $ ( "#depdate").datepicker();
- $ ( "#retdate").datepicker();
- });
- </script>
- </head>
- <body>
- <p> From: <input name = 'from' type = 'text' class="form-control" id='from' oninput='searchAirports1()'></input> </p>
- <table id="results1" style="width:50%">
- <thead>
- <tr>
- <th class = "text-center">Name</th>
- <th class = "text-center">Region</th>
- </tr>
- </thead>
- <tbody id = "tbody">
- <tr></tr>
- </tbody>
- </table>
- <p> To: <input name = 'to' class="form-control" type = 'text' id= 'to' oninput='searchAirports2()'></input> </p>
- <table id="results2" style="width:50%">
- <thead>
- <tr>
- <th class = "text-center">Name</th>
- <th class = "text-center">Region</th>
- </tr>
- </thead>
- <tbody id = "tbody">
- <tr></tr>
- </tbody>
- </table>
- <p> Departure Date: <input type= "text" id='depdate'></input> </p>
- <p> Return Date: <input type= "text" id='retdate'></input> </p>
- <button type='submit'> Search Flights </button>
- <script>
- function searchAirports1() {
- $.ajax({
- type: 'POST',
- url: '/addflight',
- data: {
- name: document.getElementById('from').value
- },
- success: function(result) {
- console.log(result);
- }
- });
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement