Mysql
 sql >> Database >  >> RDS >> Mysql

Continua la compilazione del modulo HTML dopo la chiusura e la riapertura

ecco un esempio di modulo con riempimento automatico che puoi utilizzare localstorage

 <input id="FirstName" type="text" name="FirstName" class="field-style" placeholder="First Name" required onchange="save()"/> 

 <script>
// Check browser support
if (typeof(Storage) !== "undefined") {
    if(localStorage.getItem("FirstName")!=""){

    }else{
    // Store
        localStorage.setItem("FirstName", "Hitesh");
    }
    // Retrieve
    document.getElementById("FirstName").value = localStorage.getItem("FirstName");
} else {
    document.getElementById("FirstName").value = "Sorry, your browser does not support Web Storage...";
}
 function save(){
    var name = document.getElementById('FirstName').value;
  localStorage.setItem("FirstName", name);
 }    
  </script>