On Feb 9, 12:26 pm, Michael White <m...@mickweb.comwrote:
den wrote:
inner a text element if I want to allow the insertion of only:
alphabet's letters a,b,c,.... and A,B,C,...
number and this - and this _
and not want space blank and others characters
what is the better solution ?
This is best accomplished using server-side code (PHP?) and regular
expressions.
Mick
the text is used for to assign name at new folders and new files,
so I want to reduce possible risks of dirty code by this text box;
is a good solution to limit the characters (no special characters) ?
---
and for the max lenght for name what solution is preferable to use?
---
for the letters, if the server use linux, is better to use only the
lowercase ?- Hide quoted text -
- Show quoted text -
I would disagree with the server-side comment. Unless I miss
understand the question all together. You have a text box that a user
inputs a name to assign a folder. And you want to limit what charcters
they can input into that can be sent to the server-side script. The
reason I don't agree with the server-side script comment is because
you would have to reload the page to find out if the user screwed
something up...that would take to long and especially when javascript
can do it.
You can do it one of two ways. By not allowing anything but those
characters to be typed in to the textbox (using the on keypress
function of the text box) or by scanning the string that they input
into the text onBlur or onSubmit (which ever you prefer). This way
your page determines if the fields are ready to submit before sending
it back to the server.
If I miss understood your question I am sorry otherwise if you need
more help let me know.
Adambrz
www.adambrz.com