Advertisement
noam76

form autocomplete

Apr 18th, 2022 (edited)
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.27 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1/0;">
  6.     <title>update</title>
  7.     <link rel="stylesheet" type="text/css" href="style.css" />
  8.     <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
  9.     <script type="text/javascript" src="js/jquery.validate.js"></script>   
  10. </head>
  11. <body>
  12. <div><h1>update existing <button class="learn-more" type="submit" onclick="window.location.href='/vaadbait/ContactForm/index.html';">Home page</button></h1></div>
  13.     <div id="page-wrap">
  14.         <form method="post" autocomplete="off" action="updatetenant.php" id="commentForm">
  15.             <fieldset>
  16.             <div id="formRight">
  17.                 <label for="Name">number:</label>
  18.                 <?php
  19.                 $servername = "localhost";
  20.                 $username = "root";
  21.                 $password = "";
  22.                 $dbname = "vaadbait";
  23.                 $pdo = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  24.                 $sql = "SELECT appartnmb,firstname,lastname FROM contacts";
  25.                 $stmt = $pdo->prepare($sql);
  26.                 $stmt->execute();
  27.                 $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
  28.                 if ($stmt->rowCount() > 0) { ?>
  29.                
  30.  
  31.                 <!-- dropdownlist -->
  32.                   <select class="input-bg" name="nbrselect">
  33.                   <option value="" disabled selected>choice from list</option>
  34.                       <?php foreach ($results as $row) { $appartnmbr = $row['appartnmb']; ?>
  35.                             <option value="<?php $row['appartnmb']?> <?php echo $row['appartnmb']; ?>"><?php echo $row['appartnmb']; ?>&nbsp;<?php echo $row['firstname']; ?>&nbsp;<?php echo $row['lastname']; ?></option>
  36.                             <?php } ?>     
  37.                   </select>
  38.                   <?php } ?>
  39.                   <!-- dropdownlist -->
  40.  
  41.                 <label for="Name">Lastname</label>
  42.                 <?php
  43.                 $sql = "SELECT lastname, firstname FROM contacts WHERE appartnmb='$appartnmbr'";
  44.                 $stmt = $pdo->prepare($sql);
  45.                 $stmt->execute();
  46.                 $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
  47.                 if ($stmt->rowCount() > 0) {
  48.                 foreach ($results as $row) { ?>
  49.                 <div class="input-bg">
  50.                     <input type="text" name="lastname" id="lastname" placeholder="Lastname" class="required" required="required" />
  51.                     <input type="text" name="lastname" value="<?php echo $row['lastname']?>" required>
  52.                 </div>
  53.                 <?php } ?>
  54.                 <?php } ?>
  55.                 <br>
  56.                 <input type="image" src="images/send-button.jpg" name="submit" value="Submit" class="submit-button" />
  57.             </div>
  58.            
  59.             <div id="formLeft">
  60.                 <label for="Name">FirstName:</label>
  61.                 <div class="input-bg">
  62.                     <input type="text" name="firstname" id="firstname" placeholder="FirstName" class="required" required="required" />
  63.                 </div>
  64.                
  65.                 <label for="Email">Email:</label>
  66.                 <div class="input-bg">
  67.                     <input type="text" name="mail" id="mail" placeholder="Email" <!-- class="required email -->" />
  68.                 </div>
  69.             </div>
  70.            
  71.             <div class="clear"></div>
  72.             </fieldset>
  73.         </form>
  74.     </div> 
  75.     <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  76.     </script>
  77.     <script type="text/javascript">
  78.     _uacct = "UA-68528-29";
  79.     urchinTracker();
  80.     </script>
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement