escaping - HTML Character Form -
i have text area / form:
<div><textarea name="subject" rows="3" cols="60" placeholder="please enter subject..." required="true"></textarea></div>
and if user types text area: su/bject su\bject shown.
is there html way make sure no '\' or other characters apart aa - zz taken form?
thanks in advance
when submitting, can catch result without unwanted chars doing this:
yourtextarea.value = yourtextarea.value.replace( /[^a-za-z]/g , '');
or if want strip them right on key press, modify text area this:
<textarea onkeyup="this.value = this.value.replace( /[^a-za-z]/g, '');" name="subject" rows="3" cols="60" placeholder="please enter subject..." required="true"></textarea>
Comments
Post a Comment