This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// test for localStorage support | |
if(('localStorage' in window) && window['localStorage'] !== null){ | |
var f = document.getElementById('mainform'); | |
// test with PHP if the form was sent (the submit button has the name "sent") | |
<?php if(isset($_POST['sent'])){?> | |
// get the HTML of the form and cache it in the property "state" | |
localStorage.setItem('state',f.innerHTML); |