How would I "prevent" someone from inputting too many characters into a text input screen?
Im not talking about returning zero AFTER they input too many characters and have to go back and retype their text all over again.
Example:
Bob wants to type a message. He clicks the say verb and types his text. Oops! Bob can't type his full message because the coding doesn't allow him to type more than 10 characters a message. So his message comes out: Can anyone h...
ID:171708
![]() Aug 19 2004, 12:10 pm
|
|
Airjoe wrote:
use copytext. In a browser interface you could of course put a limit on a text edit field in a form, but that doesn't guarantee they won't manually screw with the URL. Lummox JR |
to add a "..." at the end of their text if they over type would I put "If copytext returns true, text string +- "...""?
|
Excuse my french but you obviously didn't not read my thread fully. I only want a "..." at the end of the text string if the text string exceeds so many characters.
|
This is what I have so far but its no good...
mob/verb/Say(T as text) |
Please post your own thread. I know your probaly new so I will explain. Go to either the bottom or the top of the forums web page and click "Post". You'll know what to do from there.
|
ZLegend wrote:
how could they "screw" with the url and affect the number of characters allowed? They could create their own byond://? link and type it in to Dream Seeker. byond://?action=say&text=This is more than 10 letters! Never completely trust the client to validate stuff. Always have some code on the server that checks the same thing. |
ZLegend wrote:
Excuse my french but you obviously didn't not read my thread fully. I only want a "..." at the end of the text string if the text string exceeds so many characters. You should read what he posted then. It's in english. =) what you are doing in your code is adding ... to the end of the string then chopping it down to 10 chars. Example. if Bob typed "this is more than 10 chars" what you code would do is add "..." to the end of that string making it "this is more than 10 chars..." then your code cuts it down to 10 chars making the out put "this is mo" instead you should do this: verb/say(T as text) |
T.len is an undefined variable... ='( I hate these.
fixed it mob/verb/say(T as text) thanks a lot |
mob/verb/Say(T as text)
world<<"[src]: [copytext(T,1,10)]"
However, they can still type more than 10 characters. I don't think you can stop that.