Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Custom Validation Not Working

More
4 years 5 months ago - 4 years 5 months ago #6396 by Chicitadel
Custom Validation Not Working was created by Chicitadel
Hello Admin,
I am trying to include a custom validation on some of the fields (email and phone number) thus far but noticed irrespective of the RegEx code used, the custom error text will just remain uncleared.

On a particular email field, I would want to restrict the input to only a particular domain, says example.com.
Note: all email usernames have two names separated by dot (.)

Regex tried are:
^\w+[.]+\w+[@][example[.][com]$
^\w+[.]+\w+[@][e][x][a][m][p][l][e][.][com]$
^\w+[.]\w+[@][e][x][a][m][p][l][e][.][com]$
^\w+[.]+\w+[@][e][x][a][m][p][l][e][.][c][o][m]$
^(\w+[.]+\w+[@][e][x][a][m][p][l][e][.][c][o][m])$

trying to validate
namea.nameb@example.com (for true)
and every other domain for false

The error remains
Code:
invalid input

On the phone field, I wanted to restrict input to the only French phone number
I tried the following

^([+][3][3][1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])$

trying to validate +33111111111 or +33999999999 (for true, and every other country code for false)

Outcome: All validation gives the same invalid input (false). irrespective of the input.

Visforms Version 3.12.10
On Joomla! 3.9.13
Last edit: 4 years 5 months ago by Chicitadel.

More
4 years 5 months ago #6398 by Administrator AV
Replied by Administrator AV on topic Custom Validation Not Working
Hi,
I set up a test environment with 2 fields
E-Mail field: Custom validation ^(\w+[.]+\w+[@][e][x][a][m][p][l][e][.][c][o][m])$
Text field: Custom validation ^([+][3][3][1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])$
When I enter namea.nameb@example.com into the e-Mail field, the regex validates to true. Other e-mails are not excepted
When I enter +33111111111 into the text field, the regex is validated to true. If I add an additional number, for example, I receive an "Invalid Input".

I'm sorry, I have no idea, why this is not working on your website. As many other people use custom validation without problems, I think this is not a problem with visForms but must be caused by some other circumstances which are individual to your website..

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
4 years 5 months ago #6399 by Chicitadel
Replied by Chicitadel on topic Custom Validation Not Working
Thanks for the response admin,

I have tried tweaking some of the vis form field's setting but...
Do you think there is any other settings on visform field or advanced setting that must be set to true or false before using custom validation? Or any possible conditions?

Thanks

More
4 years 5 months ago #6401 by Administrator AV
Replied by Administrator AV on topic Custom Validation Not Working
Hi,
the "invalide value" is the result of the browser site validation with javascript.
So this could be related to some javascript problem...
Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: Chicitadel

More
4 years 5 months ago #6407 by Chicitadel
Replied by Chicitadel on topic Custom Validation Not Working
Thanks for the reply,
it worked now after updating to the beta version.
Additional observation why it may have not worked in the older visforms version could be related to the fact that I was using the custom validation for email on email field, and custom validation for phone on number field which may be creating additional validation behind the custom validation.

Thanks

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum