You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, gotta say that this feature is awesome, works like a charm.
I'd like to mention that if I use the color picker inside a form, when I send the information to the back-end, I receive a lot of unnecessary information, because since the color picker has input fields with the "name" attribute, all this data gets saved, even if I disable HSL and RGB picker, they're still in the DOM but not rendered, so I get the numbers anyway.
Is there any way to solve this? A way to not send everything on submit.
What I have on my form is a hidden input field that I change the value using the .onChange property when instancing it. Like this: const picker = AColorPicker.createPicker({ attachTo: 'div.colorPicker', showHSL: false, showRGB: false }).onchange = (picker) => { $('input#color').val(picker.color); };
The text was updated successfully, but these errors were encountered:
Hi @L1qu1d1c3 ,
you're right, all fields, even hidden ones, have the attribute name. In this way all of them are submitted.
I'll fix it as soon as possible.
Hi @narsenico,
Its fine and it would be an expected behaviour and I can work around it, but what I think is that if you disable certain features, like rgb or hsl, it shouldn’t even render them in the DOM.
Hello,
First of all, gotta say that this feature is awesome, works like a charm.
I'd like to mention that if I use the color picker inside a form, when I send the information to the back-end, I receive a lot of unnecessary information, because since the color picker has input fields with the "name" attribute, all this data gets saved, even if I disable HSL and RGB picker, they're still in the DOM but not rendered, so I get the numbers anyway.
Is there any way to solve this? A way to not send everything on submit.
What I have on my form is a hidden input field that I change the value using the .onChange property when instancing it. Like this:
const picker = AColorPicker.createPicker({ attachTo: 'div.colorPicker', showHSL: false, showRGB: false }).onchange = (picker) => { $('input#color').val(picker.color); };
The text was updated successfully, but these errors were encountered: