Regular expression validation working but form is not sent

gabi 10 Jan, 2020
My form has a field which require one of 5 numbers: BLDCT-0001 or BLDCT-0002 or BLDCT-0003 or BLDCT-0004 or BLDCT-0005
Someone gave me this code ^BLDCT-000[1-5]$ to put into the Regular Expression tab of the field (regex)
It is working but the form is not sent when pressing submit.

Now I am wondering what I am missing? Any ideas?

This is the homepage joomla.linedancetoender.dk containing the form
gabi 10 Jan, 2020
This is the result from the debugger if that tells you anything:
Array
(
    [72bd0bbd67ba615e75a1b4bf279854aa] => f994c9250fd117caafc81288f41ce288
    [109e4f271809a89615c3fdc7763e0e5a] => 7662ccb6912c9bf3726919d5c637f296
    [language] => de-DE
    [Itemid] => 295
    [option] => com_chronoforms6
    [lang] => de-DE
    [view] => form
)
Array
(
    [load_validate_fields] => Array
        (
            [log] => Automatic validation enabled.
            [var] => 1
        )

)
GreyHead 10 Jan, 2020
Hi gabi,

I don't see anything requiring BLDTC values in the form on that page?

The Debugger output looks as if there is no form data being submitted. That can happen if there is a problem with the routing - setting a custom Action URL might fix that http://joomla.linedancetoender.dk/index.php?option=com_chronoform6&chronoform=form_name&event=submit

Bob
gabi 10 Jan, 2020
Hey GreyHead

Think I will have to explain a bit more.
First of all the form is sending if I remove this validation.

Next, the field containing the number is collapsed.

The checkbox: Wir haben Geschenkgutscheine zum Einlösen ja/nein has an event showing the next field on choosing Ja
In the next field you have to tell how many gift cards you got and another event will then show you the box for the number

Hope you know what I mean. A bit difficult for me to explain as I am from Denmark😉
healyhatman 10 Jan, 2020
/^BLDCT-000[1-5]$/
Try with the slashes.
gabi 10 Jan, 2020
Hey Healyhatman

Tried with slashes, but still not sending.
The validation is working though[file=12532]chronoform_02.JPG[/file]
gabi 10 Jan, 2020
Sorry for uploading the picture twice, but this forum is working weird for me.
healyhatman 11 Jan, 2020
Do the validation manually then. http://www.chronoengine.com/forums/posts/t106813/validate-data-action-and-settings
gabi 11 Jan, 2020
This is really a challenge for me, because I am not a coder.
Had to try to understand and guess.

I made the field required and put the rule in the action validation

Tried different validate rules :but didnt get the validation to work.
If I put something different fx 9 into the field, the form is sent. Should have got the error message

fieldname/regex[/^BLDCT-000[1-5]$/]:Message if fail
fieldname/regex[/^BLDCT-000{1-5}$/]:Message if fail

Regular expression validation working but form is not sent image 2
gabi 11 Jan, 2020
Omg just realized I used the wrong action.
I used the validate fields action, have to use the validate data action

This was the main problem.
Using the right validate action made your first solution work.

Sorry for that, but thanks a lot for spending so much time for me.

Means I am now using Validate data action and put this in the field validation tab regex
/^BLDCT-000[1-5]$/
gabi 11 Jan, 2020
Just a note
I have 5 fields which require the same rule.
To get this working I also figured out that I have to enable the Optional tab in the field validation
Othervise, if you only choose 2 giftcards, the validation is still made on the remaining hidden fields, letting you know, that some input is missing, and form is not sent.

Saw this when using manuel validation rules in the action, but using the rule in the hidden field itself, you wont see it and the form is just not sent.

Many things to think about but important🙂

Regular expression validation working but form is not sent image 3
gabi 11 Jan, 2020
Now I have tried so much forth and back and ending up with:
Rules set in the field validation tab + Optional button enabeled
Using Validate Fields action

Now everything works fine and I think it is because of enabeling the Optional.

But what is the difference between Validate fields action and Validate data action.

Sorry for typing so much, but it is also for others like me (non coders) having a chance to learn.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger