Title: Some javascript works, some doesn&#8217;t.
Last modified: August 19, 2016

---

# Some javascript works, some doesn’t.

 *  [ndp](https://wordpress.org/support/users/ndp/)
 * (@ndp)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/some-javascript-works-some-doesnt/)
 * 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:
 * > [http://www.w3schools.com/js/tryit.asp?filename=tryjs_checkbox](http://www.w3schools.com/js/tryit.asp?filename=tryjs_checkbox)
 * > [http://www.w3schools.com/js/tryit.asp?filename=try_dom_image_src](http://www.w3schools.com/js/tryit.asp?filename=try_dom_image_src)
 * > [http://www.w3schools.com/Dhtml/tryit.asp?filename=trydhtml_intro](http://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:
 * > [http://www.w3schools.com/js/tryit.asp?filename=try_dom_input_checked](http://www.w3schools.com/js/tryit.asp?filename=try_dom_input_checked)
 * I also tried some similar functions from jQuery. No luck:
 * > [http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/](http://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.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [ndp](https://wordpress.org/support/users/ndp/)
 * (@ndp)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/some-javascript-works-some-doesnt/#post-1269488)
 * Well, I’ve partially got some information on this;
 * When I view-source on the scripts, WordPress is mung-ing the code with spurious`
   <p>` and `</p>` tags. Even though I’m using the html editor, I’ve got the visual
   editor turned off, I’m using ExecPHP.
 * So I download the “text-control” plugin, and try that out, and guess what – it
   only works for posts. Not pages. Unless I set the setting site-wide.
 * How inconvenient.
 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/some-javascript-works-some-doesnt/#post-1269503)
 * See: [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Some javascript works, some doesn’t.’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [iridiax](https://wordpress.org/support/users/iridiax/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/some-javascript-works-some-doesnt/#post-1269503)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
