E-mail validation

More
4 years 3 months ago #90331 by mimi
hi...

based on the pic i'd given, i want to make the word '(This email address is being protected from spambots. You need JavaScript enabled to view it.)' will appear when the user key in the wrong format of email.

at 1st the sentence does not appear, but when the user key in the wrong format of email, the word of '(This email address is being protected from spambots. You need JavaScript enabled to view it.)' will appear

can someone help me with this thing...

tQ so much.
Attachments:

Please Log in to join the conversation.

More
4 years 3 months ago #90358 by tpartner
Do you have a regular expression in mind to validate the format?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 3 months ago #90417 by mimi
nope... at 1st i juz trying with limesurvey validation, which is already in 'show advance setting'. and the regular expression i also using what u had give in limesurvey website. but its not working too. myb i missed some part.

ok what if i want to use php code to validate it. can i? where i must put the code.

Please Log in to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #90421 by DenisChenu
Hello,

With question code to: MAIL, the first sub code to MAIL
In the "Sub-question validation equation" :
regexMatch("/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})?$/",MAIL_MAIL)

In the Sub-question validation tip
(abcdef@example.com)

And after just need to move the text near the first input in js.
$(function() {
 $("#question{QID} .em_sq_fn_validation").insertAfter($("#question{QID} answer{SGQ}MAIL");
});

Maybe some css to have the text not displaying if good (class= good).

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 4 years 3 months ago by DenisChenu. Reason: SQG

Please Log in to join the conversation.

More
4 years 2 months ago #90984 by mimi
ok. Thank You s0 much.

Please Log in to join the conversation.