Buy Now
Sign in

Regular expression validation working but form is not sent

gabi , January 10 2020, 03:35
gabi 98
January 10 2020, 03:35 #390649
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 98
January 10 2020, 04:07 #390650
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 64
January 10 2020, 09:53 #390652
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
gabi 98
January 10 2020, 12:41 #390655
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
gabi 98
January 10 2020, 12:45 #390656
chronoform_01.JPG
Attachments
chronoform_01.JPG
chronoform_01.JPG
(26.63 KiB)
84 Downloads/Views
healyhatman 8
January 10 2020, 12:50 #390657
/^BLDCT-000[1-5]$/
Try with the slashes.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
gabi 98
January 10 2020, 13:00 #390658
Hey Healyhatman
Tried with slashes, but still not sending.
The validation is working though
Attachments
chronoform_02.JPG
chronoform_02.JPG
(58.01 KiB)
68 Downloads/Views
chronoform_02.JPG
chronoform_02.JPG
(58.01 KiB)
65 Downloads/Views
gabi 98
January 10 2020, 13:04 #390659
Sorry for uploading the picture twice, but this forum is working weird for me.
healyhatman 8
January 11 2020, 04:32 #390664
Do the validation manually then. http://www.chronoengine.com/forums/posts/t106813/validate-data-action-and-settings
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
gabi 98
January 11 2020, 16:00 #390677
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
chronoform_03.JPG
Attachments
chronoform_03.JPG
chronoform_03.JPG
(49.8 KiB)
56 Downloads/Views
chronoform_03.JPG
chronoform_03.JPG
(57.11 KiB)
62 Downloads/Views
gabi 98
January 11 2020, 16:18 #390678
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 98
January 11 2020, 16:55 #390679
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
chronoform_05.JPG
Attachments
chronoform_05.JPG
chronoform_05.JPG
(10.52 KiB)
58 Downloads/Views
gabi 98
January 11 2020, 17:49 #390680
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.