SHARE
TWEET

Untitled

a guest Sep 16th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   <!DOCTYPE html>
  2.   <html>
  3.     <head>
  4.       <!--Import Google Icon Font-->
  5.       <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  6.       <!--Import materialize.css-->
  7.       <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
  8.       <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  9.       <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  10.  
  11.       <!--Let browser know website is optimized for mobile-->
  12.       <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  13.     </head>
  14.  
  15.     <body>
  16.    
  17.    
  18.     <div class="container">
  19.    
  20.  <div class="row">
  21.         <div class="input-field col s6">
  22.           <i class="material-icons prefix">account_circle</i>
  23.           <input id="username" type="text" class="validate">
  24.           <label for="username">Név:</label>
  25.         </div>
  26.         <div class="input-field col s6">
  27.           <i class="material-icons prefix">apps</i>
  28.           <input id="tel" type="tel" class="validate">
  29.           <label for="tel">Rendfokozat:</label>
  30.         </div>
  31.         <div class="input-field col s6">
  32.           <i class="material-icons prefix">flag</i>
  33.           <input id="tel1" type="tel" class="validate">
  34.           <label for="tel1">Jelvényszám:</label>
  35.         </div>
  36.         <div class="input-field col s6">
  37.           <i class="material-icons prefix">date_range</i>
  38.           <input id="tel2" type="tel" class="validate">
  39.           <label for="tel2">Csatlakozás dátuma:</label>
  40.         </div>
  41.         <div class="input-field col s6">
  42.           <i class="material-icons prefix">drag_handle</i>
  43.           <input id="tel4" type="tel" class="validate">
  44.           <label for="tel4">IRL Név</label>
  45.         </div>
  46.         <div class="input-field col s6">
  47.           <i class="material-icons prefix">check</i>
  48.           <input id="tel3" type="tel" class="validate">
  49.           <label for="tel3">Elfogadta:</label>
  50.         </div>
  51.         <div class="input-field col s6">
  52.               <button class="btn waves-effect waves-light" type="submit" name="action" id="btn">Hozzáadás
  53.               <i class="material-icons right">add</i>
  54.            </button>
  55.         </div>
  56.       </div>    
  57.        
  58.     </div>
  59.       <script>
  60.      
  61.      
  62.       var namebox = document.getElementById("username");
  63.       var telbox = document.getElementById("tel");      
  64.       var telbox1 = document.getElementById("tel1");
  65.       var telbox2 = document.getElementById("tel2");  
  66.       var telbox3 = document.getElementById("tel2");
  67.       var telbox4 = document.getElementById("tel4");
  68.      
  69.      
  70.      
  71.      
  72.       document.getElementById("btn").addEventListener("click",addRecord);
  73.       function addRecord(){
  74.      
  75.      
  76.       var name = namebox.value;
  77.       var rend = telbox.value;
  78.       if(name.trim().length == 0 || rend.trim().length == 0){  
  79.           M.toast({html: 'Hiányos adatok!'})
  80.       } else {
  81.      
  82.        
  83.       var data = {
  84.       name: namebox.value,
  85.       rend: telbox.value,
  86.       jelvenyszam: telbox1.value,
  87.       csatlakozas: telbox2.value,
  88.       irl: telbox4.value
  89.       } ;
  90.      
  91.       google.script.run.appendData(data);
  92.       namebox.value = "";
  93.       telbox.value = "";
  94.       telbox1.value = "";
  95.       telbox2.value = "";
  96.       telbox3.value = "";
  97.       telbox4.value = "";
  98.       } //else end                        
  99.       } //record end
  100.      
  101.      
  102.       </script>
  103.       <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
  104.     </body>
  105.   </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top