This script (form) removes any HTML tags from user entered data such as a <TEXTAREA> before the form is submitted. This is generally a good idea, as HTML tags can corrupt the rest of your form contents or even pose a security risk.
We have tested the code in IE7.0, IE6.0, Firefox1.5.0.3, Opera8.54, Netscape8.1 and AOL Explorer1.2. This script worked well in all platforms with one variation observed in Firefox1.5.0.3, Opera8.54 and Netscape8.1.
- Variation has no effect on the function of the form.
- The textarea form box does not wrap (even with the attribute of wrap="virtual" inserted into the form).
- You get a horizontal scroll bar when inserting material. This is basically a normal reaction in these platforms.
For your Information:
Before we begin, we feel obligated to advise you that the above form is for all intensive purposes a "Stand Alone" script. In other words, it really does not do much of anything other than what you see. If you select to incorporate it into a functional form, you need to have a solid background in HTML, javascripts, forms and reconfigurations. If you do not need to incorporate this effect into a functional form, you can use it as a stand alone script as is without any incorporation. If you do not have a good Solid Knowledge of HTML coding, javascripts, forms and reconfigurations, please
"Do Not Attempt" to incorporate this into a working form until you are Proficient in the aforementioned areas.
* The reset button is not part of this script. We will show you further down the page howto add that attribute into the script.
Depending on your knowledge of HTML and javascripts, this is an easy two part copy and paste code that goes in two (2) places within the <BODY> section of your document.
The first part being the <script type="text/javascript"> (everything in between) </script> can go anywhere within the <BODY> section. We suggest at the very bottom of the page just above your closing </BODY> tag. Reason being, it is completely out of the way of everythinh else on your page. The second (2nd) part is the <form> </form> itself and needs to either be incorpororated into your functional form or used as a "Stand Alone" script.
Little Extra Not Included In The Script:
<form>
<textarea name="data1" style="width: 400px; height: 100px"></textarea><br />
<input type="button" value="Remove any HTML tags" onClick="stripHTML(this.form.data1)">
<input type="reset" value="Reset">
</form>
J
ust add the "Above Color Coded Section" of code into the <form> and thats all there is to that.
For your Information:
In reference to the site where you would be getting the copy and paste code for this effect. The code is incorrect and we have notified the site of this on 08/23/05. Until this is rectified, you can get a good copy of the code here.
[ Get Good Copy Of Code Here ]
This effect will also remove all the annoying little > tags you get when someone forwards you an email. Just copy and paste the email text into the form and click "Remove Any HTML Tags". Then just copy and paste the email you want to forward and it will not have those annoying little > tags.
We hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the above code until the copy and paste code has been rectified from the original script site. ( As of 03/17/07 the code is "Still Not Correct"). If you have any problems with this or anything else, feel free to consult our [ FAQ ] and if you can't find the answer there, [ contact us ].
After that, grab the below link and you are there. If you have any problems with this, feel free to contact us.
[
Get Code Here ]
[ Rate This Page ]