I am continuing my project I have now reached a dead end on my panel i created a button to reset to factory defaults to store text and numbers sto using this string document.querySelector(“#Opacit”).value = “50”; to memorize the CHECKBOX and RADIOBUTTON I tried this way but it doesn’t work document.querySelector(“#checkbox”). checked can someone help me Thank you
This seems like a basic JavaScript/HTML problem and not UXP.
If I’m completely honest, I can’t really parse what you’re asking - you say you want to reset to factory defaults (what defaults? Of what? E.g. Photoshop, your plugin, or HTML element values?), but then you appear to be asking how to store input values from checkboxes/radio buttons.
document.querySelector(“#Opacit”).value = “50”
this changes the value of the HTML element with the ID of “Opacit” to 50. It doesn’t store as a variable or “reset” anything. It’s basically a UI change.
document.querySelector(“#checkbox”).checked
this finds the first element in the DOM with the ID of “checkbox” and returns its checked value, except it doesn’t do anything on its own and at very least needs to be assigned to a variable like so let checkboxValue = document.querySelector("#checkbox").checked
At risk of repeating our previous lengthy conversation; you really need a solid grasp of basic JavaScript to use UXP.
You are absolutely right about learning JavaScript but it’s not easy to do it at my age I can try but I don’t think I can do it. anyway thanks for all the help you give. For the speech storing the factory data, I meant the uxp panel data, which has both checkbox and edittext, so when I change the settings and then I want to return them to its original input I click on the reset button and it brings everything back to how it was at the beginning. What I don’t understand is why with cep everything seems easier and more intuitive with uxp every time it’s a waste of time, couldn’t you have created something more like cep instead of changing everything?
I believe you’re confusing JS, CEP and UXP. Both CEP and UXP depend on basic JS. If one doesn’t know JS (also HTML and CSS), they won’t be able to develop proper good performant plugins. What you’re asking in this topic, has absolutely nothing to do with UXP or CEP - it’s a pure JS
What you are trying to do would’ve been exactly the same in CEP.