Hosting Solutions
mobile_logo Table of Contents

Trap User Check for Unsaved Written Work Tutorial

Learn to program a Trap user application like YouTube and Facebook have using JavaScript if the user has unsaved work or has not posted text they have composed yet before they try to leave. <!DOCTYPE html> <html> <head> <script> window.onbeforeunload = function(){ var ta = document.getElementById("user_post"); if(ta.value != ""){ return "You have unsaved work!"; } } </script> </head> <body> <textarea id="user_post"></textarea> </body> </html>

JavaScript Videos

Form Programming

Contact Form Web Application Tutorial Ajax HTML5 PHPCheckbox Toggle Tutorial Select Deselect All ElementsIn Place Editing CMS Development HTML JavaScript TutorialCustom Progress Bar Meter Development For File Upload FormsMultiphase Form Programming Tutorial Multi StepRestrict Text Input Characters HTML JavaScript TutorialMonthly Payment Loan Calculator Form Programming TutorialDynamic Select Year List Script HTML Form ElementsTip Calculator Application Form Programming Tutorialtextarea Form Field Character Counting and LimitingBuilding a WYSIWYG Rich Text Editor Textarea Replacement Part 1Building a WYSIWYG Rich Text Editor Textarea Replacement Part 2Div contenteditable Click Select All Text execCommand selectAllToggle Password Security Form Input Characters TutorialTrap User Check for Unsaved Written Work TutorialReal Time Text Input or Textarea Filter TutorialForm Select Change Dynamic List Option Elements Tutorial