- Posts: 6
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Make the validation text disappear if the regex validation text is valid
- p240901
- Topic Author
- Offline
- New Member
Less
More
5 years 9 months ago - 5 years 9 months ago #171621
by p240901
Make the validation text disappear if the regex validation text is valid was created by p240901
I'm new to customizing themes in LimeSurvey, but thought I'd share a tip.
The default behavior (at least for the bootswatch theme) is to display the regex validation text in red if the entry is invalid, and blue (with same text) if it is valid ie.:
I thought some users might find this a bit confusing: what I wanted is for the invalid regex text to only appear if the text entry was invalid (in this case for an email address). If a regex valid email address was entered, I wanted no message to appear.
To make this happen, in my custom bootswatch theme, I added the following entry to my custom.css file:
This has the effect of making the validation message disappear when the entry (email) address is valid.
I hope this might help someone, and apologies if there's a more logical or straightforward way to do this!
Pete
The default behavior (at least for the bootswatch theme) is to display the regex validation text in red if the entry is invalid, and blue (with same text) if it is valid ie.:
Code:
Please check the format of your answer.
I thought some users might find this a bit confusing: what I wanted is for the invalid regex text to only appear if the text entry was invalid (in this case for an email address). If a regex valid email address was entered, I wanted no message to appear.
To make this happen, in my custom bootswatch theme, I added the following entry to my custom.css file:
Code:
.ls-em-success { text-indent: 100%; white-space: nowrap; overflow: hidden; }
This has the effect of making the validation message disappear when the entry (email) address is valid.
I hope this might help someone, and apologies if there's a more logical or straightforward way to do this!
Pete
Last edit: 5 years 9 months ago by p240901. Reason: chg code tag
The following user(s) said Thank You: Joffm
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12937
- Thank you received: 3979
5 years 9 months ago - 5 years 9 months ago #171623
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Make the validation text disappear if the regex validation text is valid
Hi, Pete,
thank you for sharing.
This question is asked rather often.
Now there is a thread we can link to answering, instead of writing the same several times.
But please, pay attention to use the correct syntax of your code insertion.
It's better readable if you use "css" for css code, "javascript" for scripts, etc.
Best regards
Joffm
thank you for sharing.
This question is asked rather often.
Now there is a thread we can link to answering, instead of writing the same several times.
But please, pay attention to use the correct syntax of your code insertion.
It's better readable if you use "css" for css code, "javascript" for scripts, etc.
Code:
.ls-em-success { text-indent: 100%; white-space: nowrap; overflow: hidden; }
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 years 9 months ago by Joffm.
The topic has been locked.
- p240901
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 3
5 years 9 months ago - 5 years 9 months ago #171659
by p240901
Replied by p240901 on topic Make the validation text disappear if the regex validation text is valid
Thankyou Joffm, and sorry I didn't use the CSS code type.
I didn't find the answers to my question before I posted the topic, but acknowledge what I was asking I expected to be a pretty common thing, and my searching was obviously a bit 'sub-optimal'. I'll now go and see how other people solved this issue - as always with .css and HTML there are usually multiple ways to skin the cat as is said in English!
I didn't find the answers to my question before I posted the topic, but acknowledge what I was asking I expected to be a pretty common thing, and my searching was obviously a bit 'sub-optimal'. I'll now go and see how other people solved this issue - as always with .css and HTML there are usually multiple ways to skin the cat as is said in English!
Last edit: 5 years 9 months ago by p240901.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 9 months ago #171660
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Make the validation text disappear if the regex validation text is valid
Hi, personnaly i prefer to use em_validation_q
manual.limesurvey.org/Question_type_-_Sh...28em_validation_q.29
Then i can set anything for help text.
In 2.6lts template, i directly hide ti for em_regex_validation : gitlab.com/Sondages.Pro/SkeletonQuest/bl...-ui-custom.css#L1256
Then i can set anything for help text.
In 2.6lts template, i directly hide ti for em_regex_validation : gitlab.com/Sondages.Pro/SkeletonQuest/bl...-ui-custom.css#L1256
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.