Начало
Формы
Никакой HTML
Используйте JavaScript, чтобы гарантировать, что посетители не печатают в записях HTML
JavaScript Forms: Никакой HTML
<!-- TWO STEPS TO INSTALL NO HTML: 1. Paste the coding into the HEAD of your HTML document 2. Put the last code into the BODY of your HTML document --> <!-- STEP ONE: Copy this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin 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; return true; } // End --> </SCRIPT> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <form action="some-script.cgi" name=form onSubmit="return Check()"> <textarea cols="50" rows="6" name="text"></textarea> <br> <input type="submit" value="Submit Entry"> </form> <!-- Script Size: 1.11 KB -->