Re: save as you type

From: Date: Sun, 12 Dec 2004 20:18:53 +0000
Subject: Re: save as you type
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-37677@lists.php.net to get a copy of this message
You could do it with javascript, but its stupid since it'll consume a lot of processes (1 for each character typed). Tell the users to not forget it. Or as alternative:
    1 <html>
    2     <script>
    3         var submited = false;
    4         function unloadConfirm()
    5         {
    6             if (!submited) {
    7                 save = confirm("Do you want to apply changes?");
    8                 if (save) {
    9                     document.form1.submit();
   10                 }
   11             }
   12         }
   13     </script>
   14     <body onUnload="unloadConfirm();">
   15         <form name="form1" action="script.php" method="post">
   16             <input type="text" name="text1" onChange="submited = false;"
   17             <input type="submit" value="Apply changes" onClick="submited
   18         </form>
   19     </body>
20 </html> When the user quits the page and the form wasn't submited yet, it will ask to apply. Rodrigo K -----Original Message----- From: Matthew Perry [mailto:matt@sweetwaterpoolsinc.com] Sent: 12 December 2004 05:12 To: php-db@lists.php.net Subject: [PHP-DB] save as you type Is there a way to make an input box save data into a database as users type? My users keep forgetting to press my "apply changes" buttons. Matthew -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#37677) next »