Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control option field to enter custom attributes #556

Open
mkgn opened this issue Jul 13, 2017 · 2 comments
Open

control option field to enter custom attributes #556

mkgn opened this issue Jul 13, 2017 · 2 comments

Comments

@mkgn
Copy link

mkgn commented Jul 13, 2017

I am aware that there is typeUserAttrs which allow user to add custom attributes. However this needs to be done via code. Let's say that there is a requirement to use a validator such as http://parsleyjs.org which allows you to decoratively specify validation rules (data-parsley-*).

So, if by default a custom attribute field is available for all controls, this kind of requirements can be fulfilled. In my case if I had this option, I just have to keep the validation scripts in place and the person who design the form will have to learn the data-parsley-* options. He will just add those to our new "Custom element attribute" field. Then when the form is being filled by the end-user, those fields has all the validation custom attributes set and validation will get fired.

Also, a text area by default for every field can be provided to enter custom script? Can be useful in some cases?

Do you all think that this will be a valid use case?

@kevinchappell
Copy link
Owner

With typeUserEvents and typeUserAttrs it's possible to add a special attribute that enables users to add parsley options without knowing parsley. With some extra js you can provide a simple ui that let's then choose validators.

The same options can be used for the textarea that allow scripts, though if users have trouble assuming parsley options they will surely write page breaking js in the textarea.

@bhavna11patidar
Copy link

Hello Kelvin,
I have created a custom attribute of checkbox using typeUserAttrs. At the time of editing of the checkbox , it is unchecked everytime even though the value of checkbox is true..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants