Description: This script converts special HTML characters to their entities version inside user entered data such as a TEXTAREA before the form is submitted. Specifically:
- '<' becomes '<'
- '>' becomes '>'
- '"' (double quote) becomes '"'
- ''' (single quote) becomes '''
- '&' becomes '&'
This helps prevent potentially harmful or disruptive HTML tags from being posted to your form.
See also: Strip HTML Tags (form) script
Example:
Directions: Simply add the below script into the <BODY> section of your page:
<script type="text/javascript"> // HTML to Entities (form) script- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use