Advertisement
Guest User

Untitled

a guest
Nov 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.25 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <!-- Latest compiled and minified CSS -->
  5.     <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"><!-- jQuery library -->
  6.  
  7.     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js">
  8.     </script><!-- Latest compiled JavaScript -->
  9.  
  10.     <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js">
  11.     </script>
  12.     <style>
  13.        td {
  14.           border: 1px solid black;
  15.        }
  16.     </style>
  17.     <title></title>
  18. </head>
  19. <body>
  20.     <button onclick="toggleView('searchPage')">Search</button> <button onclick="toggleView('suspectView')">Current Suspect</button>
  21.     <div id="searchPage">
  22.         <h3>A demonstration of how to access a Text Field</h3><input id="searchText" type="text" value="Input your search here"> <button onclick="search()">Search</button>
  23.         <table id="searchResults"></table>
  24.     </div>
  25.     <div id="suspectView">
  26.         <table border="0" id="searchResults">
  27.             <tr>
  28.                 <td>
  29.                     <table border="0" class="table">
  30.                         <thead class="thead-inverse">
  31.                             <tr>
  32.                                 <td colspan="2">Suspect Details</td>
  33.                             </tr>
  34.                         </thead>
  35.                         <tr>
  36.                             <td style="width:10%">First Name:</td>
  37.                             <td id='firstname' style="width:90%">John</td>
  38.                         </tr>
  39.                         <tr>
  40.                             <td style="width:10%">Last Name:</td>
  41.                             <td id='lastname' style="width:90%">Doe</td>
  42.                         </tr>
  43.                         <tr>
  44.                             <td style="width:10%">Suspect Profession:</td>
  45.                             <td id='profession' style="width:90%">Thief</td>
  46.                         </tr>
  47.                         <tr>
  48.                             <td colspan="2">Police Interactions</td>
  49.                         </tr>
  50.                         <tr>
  51.                             <td colspan="2">
  52.                                 <ul class="list-group">
  53.                                     <li class="list-group-item list-group-item-success">11/24/2017 11:26PM - Sheriff Barrett: Suspect was caught running a red light at 108 MPH. Short 10-80 ensued, suspect 10-50'ed and surrendered immediately. Suspect accepted charges without representation for 20 months.</li>
  54.                                     <li class="list-group-item">11/24/2017 09:52PM - Sheriff Bidwell: Suspect was clocked going over 100MPH on Los Santos. Searching his plate in the DMV revealed suspect identity. Unable to catch suspect, added BOLO for his vehicle Plate of 01TMV381.</li>
  55.                                 </ul>
  56.                             </td>
  57.                         </tr>
  58.                     </table>
  59.                 </td>
  60.                 <td>
  61.                     <table border="0">
  62.                         <tr>
  63.                             <td colspan="2">Known Vehicles</td>
  64.                         </tr>
  65.                         <tr>
  66.                             <td>Vehicle Name</td>
  67.                             <td>Vehicle Plate</td>
  68.                         </tr>
  69.                         <tr>
  70.                             <td>Vehicle 1</td>
  71.                             <td>01TMV381</td>
  72.                         </tr>
  73.                         <tr>
  74.                             <td>Vehicle 2</td>
  75.                             <td>01TMV381</td>
  76.                         </tr>
  77.                         <tr>
  78.                             <td colspan="2">Past Charges</td>
  79.                         </tr>
  80.                         <tr>
  81.                             <td colspan="2">
  82.                                 <ul class="list-group">
  83.                                     <li class="list-group-item list-group-item-success">11/24/2017 11:26PM - Sheriff Barrett: 1x Fleeing & Eluding, 1x Reckless Driving, 1x Failure to Stop. 20 Months, $16,000 Fine</li>
  84.                                     <li class="list-group-item list-group-item-success">11/24/2017 11:26PM - Sheriff Barrett: 1x Fleeing & Eluding, 1x Reckless Driving, 1x Failure to Stop. 20 Months, $16,000 Fine</li>
  85.                                 </ul>
  86.                             </td>
  87.                         </tr>
  88.                     </table>
  89.                 </td>
  90.             </tr>
  91.         </table>
  92.     </div>
  93.     <script>
  94.  
  95.        var pages = ["searchPage", "suspectView"];
  96.  
  97.        function search() {
  98.           var searchText = document.getElementById("searchText").value;
  99.           var table = document.getElementById("searchResults");
  100.           var row = table.insertRow(0);
  101.           var cell1 = row.insertCell(0);
  102.           var cell2 = row.insertCell(1);
  103.           cell1.innerHTML = "Search Text: " + searchText;
  104.           cell2.innerHTML = "javascriptLinkText";
  105.        }
  106.  
  107.        function toggleView(view) {
  108.           var totalPages = pages.length;
  109.           var i;
  110.           for (i = 0; i < totalPages; i++) {
  111.               var x = document.getElementById(pages[i]);
  112.  
  113.               if (pages[i] === view) {
  114.                   x.style.display = "block";
  115.                   console.log("Setting " + pages[i] + " to block");
  116.               } else {
  117.                   x.style.display = "none";
  118.                   console.log("Setting " + pages[i] + " to none");
  119.               }
  120.           }
  121.        }
  122.  
  123.        document.getElementById("suspectView").style.display = "none";
  124.     </script>
  125. </body>
  126. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement