Enable validation for all fields in backend form creation - typo3

In Typo3 v 11.5.21 and Powermail version 10.6.0 By default, only freeform fields such as Text and Textarea allow selection of validation rules in the Extended tab.
This image shows the validation selection field in a text form field.
I've implemented an Powermail extension that introduces a custom PHP validation that's supposed to make it easier for my editors to control certain aspects of a form field. However, my editors would need to use those on other fields, primarily checkboxes, radio buttons and selection fields.
Is there a way to enable validations for those fields, too?

Related

Does tinymce have an option, via menu, to insert form fields into it or just by editing the code?

Does anyone know of a ready-made plugin that allows adding input, textarea, select etc. on tinymce?
The tinymce.dom.Selection API (https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#select) allows you to select elements or set content in the TinyMCE editor. You can assign the API class to an action or an interaction element like a button or form, and any selected content will be replaced with the contents the API action passes in.
If that's not a good fit for what you need, is there an example of the type of adding input, a textarea, or a select you're looking for?
There are no official plugins that allow such interactive elements to be added. TinyMCE is a text editor that is built to create blog posts, articles, etc. By design, it is not a page builder. However, there may be some unofficial plugins on GitHub that may implement such features.
If you are going to insert forms and text areas that should not be edited or reconfigured afterward, you can use templates. They may come as any valid HTML. Thus, some fixed forms can be just saved as templates.
Another way is, of course, inserting HTML directly into the code.

Symfony: unique options in embedded form collection

I have an embedded form collection in Symfony. Which is working nice. I am working with a manytomany assocation mapping.
Except i want to create (with javascript?) the form so that only unique values are available. In my example i have an Organisation which can exist of many users. When i add user "L" in this case and i want to add a second user i want to prevent that user "L" is available in the other dropdown.
The way i embedded the collection of forms is exactly like the documentation of Symfony has learned me. (http://symfony.com/doc/current/cookbook/form/form_collections.html)
Down below is an example of how it works now (in this example I want to prevent that in the dropdown the user "L" is available as an option.
Thank you very much!
Unfortunately, there's no way you can make the HTML form behave this way. HTML forms just do not have any composite (or dependent) <select> widgets. So, the right way to go here would be:
validating the form server-side, so that duplicate values in two select boxes are not allowed;
adding some JavaScript code to the view that renders form. Perhaps this code should listen to <select>s' onChange events, and once an event is received, the option selected in the first box should either receive a disabled attribute or get deleted.

Dynamics AX 2012 - CommandButton insert and edit by form

I've created form that should insert, edit and delete row by usig CommandButtons.
Propierity is set in Command field to New, Edit record and delete.
Generally it works, but its not safe, because it is editing rows without using CommandButton.
I don't know how to make data Source or CommandButton propierities to edit record only with button, not automatically.
This is how standard AX 2012 forms behave, if created using form templates as described here.
To create a form with a template, right-click Forms in the AOT, click New Form from template, and then click the template that specifies the type of form you want to create. A form is generated from the specified template. The new form contains controls that implement the form structure specified by the design pattern for that form. In addition, several properties are populated with values that apply to the specified type of form. To complete the form, you add controls that provide access to the data and actions that the form supports.
Consider using the SimpleListDetails form template. The grid has AllowEdit set to No, while the details part allows editing, if in edit mode. Whether edit or view mode is the default is a user setup.
Ok...using all properties combination there is simple way:
Just set on Menu Item "OpenMode" to "Viev" and editing is disabled utill user use right CommandButton.

Is there any option in Croogo CMS to add my own form and validation functionality?

Is there any option in Croogo CMS to add my own form and validation functionality?
Croogo is built on top of CakePHP, so you can of course add your own Models (with validation), Forms, etc.
Read:
http://book.cakephp.org/2.0/en/models.html
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html

How to enforce wicket to validate disabled fields on the page right before onsubmit call

if we use setEnabled(false) say on text input type it disables and not take part in form validation so how can i enoforce this right before onsubmit
As a general rule browsers do not submit the value of disabled fields at all. (As mandated by the HTML standard)
It's important to see that because of the browser sending no data, the problem is framework-neutral. The solution is also independent of your framework:
Double-fielding: each text field that you intend to disable should have a "shadow" hidden field where its value is copied.
In the Javascript function that does the submitting you can re-enable the fields for the time of submit only. I haven't tried this option yet so I'm not sure if this is a good idea or indeed if it works (it should though).
A separate, Wicket-specific issue is that even if the browser submits the values, any Wicket component which has setEnabled(false) called will refuse to process them. So you'll have to extend double-fielding into your Wicket component structure as well, which won't look very nice.
So it's doable but you should know that users will not expect disabled fields to be submitted and you're likely to cause confusion by changing the standard behaviour of form inputs. You might want to think about redesigning your UI as an alternative option.
If the component is disabled it won't have any input to be validated. I'll assume from now on that you want to execute a FormValidator which involves some other components' user input and this disabled TextField's model object.
Unless you return the disabled TextField in FormValidator.getDependentFormComponents(), the FormValidator will continue to execute. Take into account that FormComponent.getConvertedInput() won't return anything, because there's no input. You can get the Modelobject instead by using FormComponent.getValue().