»
EnglishFrenchVietnamese

Print - Removing HTML script - JavaScriptBank.com

Full version: jsB@nk » Utility » Counter-Limitation » Removing HTML script
URL: https://www.javascriptbank.com/removing-html-script.html

Removing HTML script © JavaScriptBank.comThis JavaScript is intended to ensure that people do not use HTML tags in form messages, Web forums, and so on. Type some text with HTML tags in the box to try it out.

Full version: jsB@nk » Utility » Counter-Limitation » Removing HTML script
URL: https://www.javascriptbank.com/removing-html-script.html



JavaScript
<SCRIPT language=JavaScript><!-- function Del(Word) {a = Word.indexOf("<");b = Word.indexOf(">");len = Word.length;c = Word.substring(0, a);if(b == -1)b = a;d = Word.substring((b + 1), len);Word = c + d;tagCheck = Word.indexOf("<");if(tagCheck != -1)Word = Del(Word);return Word;}function Check() {ToCheck = document.form.text.value;Checked = Del(ToCheck);document.form.text.value = Checked;alert("This form is not set to submit anywhere so you will stay here.  But please notice that the text box's contents have been \"filtered\".");return false;}// --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM name=form onsubmit="return Check()"><TEXTAREA name=text rows=6 cols=50></TEXTAREA> <BR><INPUT type=submit value="Submit Entry"> </FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->