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

F

F. Da Costa

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top