Some javascript works, some doesn’t.
-
I am trying to include some form fields (checkboxes) in a post – and the default settings of some checkboxes are dependent on what the user selects for other checkboxes.
So I tried inserting some javascript INLINE in some of my posts. This has worked very well for php, using the ExecPHP plugin. I initially tried a few simple examples, since I’m really a beginner at javascript, and they worked well too:
https://www.w3schools.com/js/tryit.asp?filename=tryjs_checkbox
https://www.w3schools.com/js/tryit.asp?filename=try_dom_image_src
https://www.w3schools.com/Dhtml/tryit.asp?filename=trydhtml_intro
Then I tried some examples of javascript functions I actually NEED, like manipulating checkbox settings onClick:
https://www.w3schools.com/js/tryit.asp?filename=try_dom_input_checked
I also tried some similar functions from jQuery. No luck:
https://www.electrictoolbox.com/check-uncheck-checkbox-jquery/
They just do nothing. Nothing at all.
Why is it that SOME javascript works fine – some javascript just doesn’t do anything? No errors. Nothing.
I can set my checkboxes to be interdependent based on php; but that requires a post and refresh, and by that time, the user’s confused about the relationship between the checkbox. The user needs immediate feedback to “get” the relationship.
- The topic ‘Some javascript works, some doesn’t.’ is closed to new replies.