ShMiL
03-31-2003, 02:41 PM
I have a text field in the DB that it's maximum length is 150 chars.
Now I have a form with <textarea> in which I allow to input ONLY 150 chars (using JS script).
The problem is that I have an habbit to always use a function (vb) which encodes the data before I add it to the DB - it replaces many problematic chars (like: <,>,",',& and some more) with it's HTML-ic replacement (like: &# 34;,&# 39;,& lt; etc).
I guess you understand the probblem...
When the user inputs the char: < the JS sees it as one char, but after I encode it for the DB it becomes: < which is three chars!
Anyone have any idea?
If I could change the JS script to recognize "my" problematic chars and to count them recording to it's replacements.
Thanks
Now I have a form with <textarea> in which I allow to input ONLY 150 chars (using JS script).
The problem is that I have an habbit to always use a function (vb) which encodes the data before I add it to the DB - it replaces many problematic chars (like: <,>,",',& and some more) with it's HTML-ic replacement (like: &# 34;,&# 39;,& lt; etc).
I guess you understand the probblem...
When the user inputs the char: < the JS sees it as one char, but after I encode it for the DB it becomes: < which is three chars!
Anyone have any idea?
If I could change the JS script to recognize "my" problematic chars and to count them recording to it's replacements.
Thanks