Forums

Some javascript works, some doesn't. (3 posts)

  1. NDP
    Member
    Posted 2 weeks ago #

    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=try_dom_image_src

    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

    I also tried some similar functions from jQuery. No luck:

    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.

  2. NDP
    Member
    Posted 2 weeks ago #

    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.

  3. iridiax
    Member
    Posted 2 weeks ago #

Reply

You must log in to post.

About this Topic

Tags

No tags yet.