Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Validate phone and email in Multiple short text - by: IngeborgNor

$
0
0
I've made an example, see attached group:

File Attachment:

File Name: kontaktinfo.lsg
File Size: 6 KB


Question validation equation:
(is_empty(kontaktinfo_epost) or regexMatch('/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/',kontaktinfo_epost)) and
(is_empty(kontaktinfo_tlf) or regexMatch('/^[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}$/',kontaktinfo_tlf))

Question validation tip (nb):
{if(regexMatch('/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/',kontaktinfo_epost),'Takk, eposten ser riktig ut <br />','Skriv inn en riktig epostadresse.<br />')}
{if(regexMatch('/^[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}[0-9]{2}[\(\)\.\- ]{0,}$/',kontaktinfo_tlf),'Takk, telefon ser riktig ut','Skriv inn et riktig telefonnummer, åtte siffer.')}

And I think that the Sub-question validation equation is only useful if all the subquestions have the same criteria, etc. all should be email-addresses.

Viewing all articles
Browse latest Browse all 17529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>