Can anyone help me understand why one checkbox ("noodle") is checked, but the other ("beef") is not? I expect both to be unchecked by default.
They behave correctly when I use BBEdit to preview it, but when I paste the code to the Custom HTML prompt in KM, the "noodle" checkbox is checked by default.
The code has been simplified. I have more lists. the checkbox under in the "Noodle" block are all checked by default (I don't know why!). All others are not.
Thanks, @peternlewis. That's very helpful! I see what was going on now.
In addition to the reason you mentioned, it was also because I tried the "window.KeyboardMaestro.Submit()" function. When I click the submit button, with the checkbox item "noodle" selected, KM creates a variable called "noodle" and set it to "1". I did not select "beef", therefore, KM creates a variable called "meat" and set it to "0".
I don't want to create these "HTML name attribute" variables such as "meat" or "noodle", so I guess the best option is not to use the "window.KeyboardMaestro.Submit()" function.
Even without the window.KeyboardMaestro.Submit() the values will still be drawn from the Keyboard Maestro variables of matching names unless you use the data-kmignore or other attributes.
Thanks! That’s helpful to know. I don’t have these variables, so its not a problem for me now. But in case i may create them in future, i guess its better to add data-kmignore to it.