Welcome to the LimeSurvey Community Forum

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

How to show placeholder, mask and validate input for multiple short text?

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 4 months ago #232294 by blocka
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.29
Own server or LimeSurvey hosting: Own
Survey theme/template: vanilla
==================
I'd like to use multiple short text to collect a phone number and email address. I'm looking for a way to:
a) Show a placeholder in each input box to indicate the format of input
b) Validate the input:
   i) Verify email has a validate format
   ii) Verify phone number is numeric and contains two hyphens in the proper locations
Ideally, I'd like to apply a mask for the phone number so user can type digits only, and end up with an input in the format ###-###-####

I've attached my multiple short text question -- hoping maybe someone already has a solution for this.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago - 2 years 4 months ago #232295 by Joffm
Hi,
you can use the plugin "jquery mask" from Igor Escobar.
[url] igorescobar.github.io/jQuery-Mask-Plugin/ [/url]

Here an image of my Tutorial "Gimmicks und andere..."
 


Or the plugin "Inputmask"
[url] github.com/RobinHerbots/Inputmask [/url]
 
Here you can use a regex inside the mask or a "greedy" mask to validate the email format.

Unfortunately you did not provide a lss export, only lsq.
So I can't provide a workig example.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 4 months ago by Joffm.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose