[xwiki-users] Problem with Validation Regular Expression
Hi everyone, I was trying to reproduce the tutorial of the form with validation and tooltips. I have a field "name" that I want to be between 1 and 10 characters (like first_name in the tutorial). The Validation Regular Expression for this field is : /.{1,10}/ I've made others fields with Validation Regular Expression /.+/ and these fields work without problem. But, when I enter the field "name" with more than 10 characters, the Validation Message doesn't appears and my form is validated. But, I don't want my form to be validated, because the field "name" is too long. Is there a problem anywhere (I copy all the code giving in the tutorial) ? /.{1,10}/ is it a deprecated expression ? Please help me ^^ Best regards, Stéphanie -- View this message in context: http://xwiki.475771.n2.nabble.com/Problem-with-Validation-Regular-Expression... Sent from the XWiki- Users mailing list archive at Nabble.com.
Please, does someone have a response ? My field "name" is made like that : - Validation Regular Expression : /.{1,15}/ - Validation Message : ApplicationClass_nameValueError And I have a translations page (that is weel defined in my "Wiki Administration Page") and said : Space.ApplicationClass_nameValueError=Your name is too long As I said before, when I don't want an empty field, I use /.+/ and a Validation Message and there is no problem. Is the expression /.{1,15}/ a deprecated expression or is there a problem somewhere ?? Thanks for your response. Best regards, Stephanie -- View this message in context: http://xwiki.475771.n2.nabble.com/Problem-with-Validation-Regular-Expression... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Stephanie, 2011/10/12 Stéphanie <[email protected]>:
Please, does someone have a response ?
My field "name" is made like that :
- Validation Regular Expression : /.{1,15}/
I just tested and this regular expression matches any name that _contains_ a sequence of 1 to 15 characters. You want to match the entire name so you have to use: /^.{1,15}$/ ^ and $ mark the start/end of the name. Hope this helps, Marius
- Validation Message : ApplicationClass_nameValueError
And I have a translations page (that is weel defined in my "Wiki Administration Page") and said : Space.ApplicationClass_nameValueError=Your name is too long
As I said before, when I don't want an empty field, I use /.+/ and a Validation Message and there is no problem.
Is the expression /.{1,15}/ a deprecated expression or is there a problem somewhere ??
Thanks for your response.
Best regards, Stephanie
-- View this message in context: http://xwiki.475771.n2.nabble.com/Problem-with-Validation-Regular-Expression... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thank you very very much. It's exactly the solution to my problem. Best regards, Stéphanie -- View this message in context: http://xwiki.475771.n2.nabble.com/Problem-with-Validation-Regular-Expression... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
Marius Dumitru Florea -
Stéphanie