Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Regex

  • clivemorris
  • clivemorris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 months 1 week ago #266348 by clivemorris
Regex was created by clivemorris
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi,
I'm using CE 6.6.1 using our own servers.
I'm trying to get a surname field to only allow text and one hyphen, no numbers or other chars.
I've added a regex to the regex field for the surname. The field highlights when invalid chars are entered but doesn't remove them.
Regex = /^[a-zA-Z]+(-[a-zA-Z]+)?$/

Does this need some javascript attaching to the survey to achieve this?

Thanks,
 

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 months 1 week ago #266349 by holch
Replied by holch on topic Regex
Regex only checks if there is something wrong and highlights it. It can't correct or remove anything.

If you want to remove things, you will have to find a Javascript solution (make sure your installation is setup so you can use Javascript).

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose