Symfony 5.4 display nested form validation error - forms

I'm developing a Symfony 5.4 site and I'm using Nucleos User Bundle and Nucleos Profile Bundle for registration and profile managing.
Profile model has a BillingData property which is associated to a BillingDataType subform.
BillingData is marked with an Asset\Valid annotation which works, but I can't manage to display error messages beside BillingDataType fields.
In form vars I can see that BillingDataType subform is valid, whereas ProfileType parent form is valid, even if I set error_bubbling param to false.
So I'm wondering if there would be a way to display correctly field errors without adding a lot of custom code in template file.

Related

What is the best way to create a form with a confirmation page?

I would like to create the following form:
Step 1: The user enters his contact details.
Step 2: A confirmation page, where the user has the possibility to confirm or edit his entered data again (back to step 1)
The contact details are stored in an entity domain object. The properties have annotations for validation.
My problem:
When I pass the contact object to the confirmation page, I get the message
Could not serialize Domain Object Vendor\Extension\Domain\Model\Object. It is neither an Entity with identity properties set, nor a Value Object.
I understand that I cannot pass a non-persistent domain object. A tip I found was to convert the object to an array and back again later. This works to display the input on the confirmation page. But if the user edits the data, I lose the validation functionality when converting to an array.
Another possibility would be to persist the object already after step 1 (temporarily?) . The problem here is that the data must not be displayed in the backend (they are not yet confirmed). In addition, unused data is created if the user cancels the process.
Is it possible to save objects temporarily?
What is the most elegant solution to this problem?
If you only wan't to create a form, why don't you use a form plugin like Ext:form or Ext:powermail? These have a summary page by default. And you have the possibility to write the entered data into you're database.

How to show single form validation error message for multiple form fields in codeigniter

I have a simple form which has only two(email, password) fields. I'm using codeigniter's form validation library to validate that form. And it's working fine, but not the way I wanted to.
I want to show only one error message when email or password field empty. or when both fields are empty. not two error messages for each fields.
How can I do that in codeigniter using it's form_validation library.
Use form_error() function http://www.codeigniter.com/user_guide/libraries/form_validation.html look up Showing Errors Individually

Is there a way to remove field value using model in CakePHP?

I'm developing an application in CakePHP 2.7 and I have a form where that sends off an Ajax request from a file input and returns some information. This information is then stored inside a hidden form field.
I have a custom validation rule that checks against the hidden field and another to see if both have been submitted as the system can only handle one. When the validation rule returns false it flags up an invalidate message to notify the user of the issue. However now I am left with an issue where the hidden field still contains a value and so does the other field the user filled out but I can't remove the value from the hidden field.
Is there any way I can remove the value from the hidden field inside the model?
I have looked at this question on StackOverflow but it wasn't successsful in helping and dates back to an earlier version of CakePHP based on the date of the question.

Translate the text error required fields in a form with Symfony2

I'm developing an application with Symfony2 and I try to translate texts form validation (required). Validation is done by the browser and I get eg "Veuillez renseigner ce champs" I wish I could translate the customer or switch also navigation.
My forms are made with buidform.
Thank you in advance for your help
Olivier
If you are referring to the browser validation raised when a field has an attribute required, this does not depend on symfony. I'm not sure you can set a language for these messages as they are generated by the user's browser.
A solution for you might be to disable browser validation (ie set required to false in your formBuilder fields) and rely on Assertions in you entities whose messages you can customise, you'll find more about this here.

Attask- how to know that whether particular custom form is selected in the task or not

I want to search only those task from the project, which has a particular custom form (though not selected any field).
attask/api/task/5775...?fields=parameterValues,category
This returns only first custom form(category) object selected in the task and not all the custom forms..
I want to find all those task which contains particular categoryID..
Attask/api/ task/search?categoryID= 46785335&fields=parameterValues
It doesn't return me response when custom form selected after another custom form..
Since multiple custom forms is a new feature it is still only in earlyAccess this has not been released to the current API. You can however do this using the unsupported API.
the following will do what you are wanting.
GET attask/api-unsupported/task/search?objectCategoriesMM:ID=55a4232e005dc2668af39a4f24a4db40
This will search all forms not just the primary(first) form