Howto call onchange() via JS NOT via a direct user-action

Discussion in 'Javascript' started by F. Da Costa, Feb 2, 2004.

  1. F. Da Costa

    F. Da Costa Guest

    Hi,

    Trying to call/ mimic an onchange function/ event after a user has clicked
    a checkbox.
    In response to which a buncch of other ones need to be checked as well.
    The caveat is that each of those child-checkboxes need to have an onchange
    action take place.
    All of these child-boxes *have* got a working onchange eventListener
    attached (thx to an old post of Lasse Reichstein Nielsen).

    Following a snip that suggests that the inputElement.onchange is void, so
    calling onchange is a bit hard.
    Any suggestions?

    ....
    inputElement = _row2checkbox[tb.rows["id"]];
    inputElement["checked"] = el["checked"];
    if (inputElement.onchange) {
    inputElement.onchange();
    }
    ....

    I guess I could find another way to make it work but that would ivolve some
    serious trickery because I also need some other elements which are
    incorporated in the onchange at 'attachment time'.

    TIA
    Fermin DCG
     
    F. Da Costa, Feb 2, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    833
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,131
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,856
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,576
    Richard Senior
    Apr 27, 2007
  5. John
    Replies:
    0
    Views:
    911
Loading...

Share This Page