Validation field in field group

3 years 4 months ago #321189 by ericmuc
Validation field in field group was created by ericmuc
Hi,

"Required" I cannot set in the fields of the field groups because I don't want to have that in many required tabs / groups / fields in profile edit.

My question now:

Can I add a validation with the "CB Code Field" in the group field that validates before saving the filed group, whether some fields are not empty?

Best regards
Eric

Please Log in to join the conversation.

3 years 4 months ago #321191 by krileon
Replied by krileon on topic Validation field in field group
Code Validation and Query Validation both work on fields inside of field groups. As for what they validate would be up to you as you'd need to supply that code.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 4 months ago #321194 by ericmuc
Replied by ericmuc on topic Validation field in field group
Hi,

OK, but I think not with a check at pressing the save button of the field group, right? Only if the field value of a special field is set.

Is there a possibilty to work with CB Auto Actions?

Thanks, best regards
Eric

Please Log in to join the conversation.

3 years 4 months ago #321201 by krileon
Replied by krileon on topic Validation field in field group
The check at form submit is skipped. Ajax validation rules can not block the form as there's too much risk of it bricking the form and being unable to ever submit if it something goes wrong with the ajax request. The validation should still be applied during server side processing of the form though and they'll be sent back to profile edit if it fails. We already have a feature ticket to try and improve the validation so it has some failsafes built in so that ajax validation can block form posts.

forge.joomlapolis.com/issues/8177


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 4 months ago #321231 by ericmuc
Replied by ericmuc on topic Validation field in field group
Hi,

Ok, thanks for the reply.

Let me summarize, why I started this post.

I have following use case:

"four field groups with up to 8 fields, to add multiple data sets (for example in a cv the multiple career steps)"

The output is done within the group field and can be perfect designed with substitutions and css. So until here is very good.

Now I have two hurdles:

1) if the group field has for example 6 data sets, the user cannot directly edit one of them but have to open the field group and scroll down to the right data set, it would be very good, if he could have a direct ajax front edit only for the single data set

2) I am searching for a way to have valid data sets, because there is for example a data calculation in the background with 2 fields, so there is the need to set some fields in a way they are "required". To use the original CB required is not possible because of no possibility to split profile editing. In the profile all tabs are shown and every required field here blocks saving the whole profile without having data in the field.

So here I am searching for guiding the user to fill in the appropriate data. Conditional fields are not working in ajax front end in field groups. Validation rules don't blocks "save", for example I need to block save if a field is empty, but again only in the front end editing, this may not be like the required function which blocks the profile edit.

I managed it already, that in the field group only the data set is shown, if no field is empty. But this message will be shown after saving, that is not the right way.

So if it would be possible to block save if a field of a field group is empty in ajax font end editing which is not required with the general save button in profile edit, that could be the solution.

Thanks a lot for all, best regards
Eric

Please Log in to join the conversation.

3 years 4 months ago #321232 by krileon
Replied by krileon on topic Validation field in field group

1) if the group field has for example 6 data sets, the user cannot directly edit one of them but have to open the field group and scroll down to the right data set, it would be very good, if he could have a direct ajax front edit only for the single data set

That's planned in a future release of CB Core Fields Ajax.

2) I am searching for a way to have valid data sets, because there is for example a data calculation in the background with 2 fields, so there is the need to set some fields in a way they are "required". To use the original CB required is not possible because of no possibility to split profile editing. In the profile all tabs are shown and every required field here blocks saving the whole profile without having data in the field.

Add a condition to the entire field group field so it's only visible if relevant. Then your required check won't apply if the field isn't relevant to the user. What it conditions off of is entirely up to you. Could simply be a checkbox field to note that yes they have career steps. A user adding a blank row of fields would of course trigger validation which they can avoid by just not having that row.

Conditional fields are not working in ajax front end in field groups.

Correct, those integrations do not work on fields inside of a field group. As explained multiple times those fields do not actually exist so those plugins have no idea how to handle conditioning and ajax edit for a field that doesn't actually exist.

Validation rules don't blocks "save", for example I need to block save if a field is empty, but again only in the front end editing, this may not be like the required function which blocks the profile edit.

You're using ajax validation rules. Those can not block form post. See previous reply where I've already explained this. They should block the profile from actually saving if validation actually failed though.


I do not have a perfect solution for you. What you want is not implemented yet. CB Conditional, CB Core Fields Ajax, and CB Privacy do not work on fields inside of a field group at this time.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: ericmuc

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.412 seconds

Facebook Twitter LinkedIn