PDA

View Full Version : regexp and textfields



realtebo2
4 Aug 2009, 10:54 AM
I'd like to allow user to enter only alpha chars lowe cased, I inserted this

maskRe : /[a-z]/i


but i can insert also upper case chars... what is wrong?

second answer: which is the differences from /i and /ig ?

steffenk
4 Aug 2009, 2:24 PM
try without modifier(s)

maskRe : /[a-z]/

zhegwood
4 Aug 2009, 2:25 PM
I'd like to allow user to enter only alpha chars lowe cased, I inserted this

maskRe : /[a-z]/i


but i can insert also upper case chars... what is wrong?

second answer: which is the differences from /i and /ig ?

i = case insensitive
g = global

ValterBorges
26 Aug 2009, 7:10 PM
try this:




maskRe : new RegExp([a-z],"i")