41

Re: Multiple Select Helper plugin

yonosoytu wrote:

Don't know if you can pass another arguments, but you can use DOM to get the label...

function myOnClickFunction(event) {
  var checkbox = Event.element(event);
  var label = checkbox.parentNode.getElementsByTagName('label')[0];
  // ... here your code ...
}

It's a bit tricky, but I don't know how to get the label assigned to a form element easily with Javascript.

Thank you yonosoytu. This seems to get me the label element:

var checkbox = Event.element(event);
var label = checkbox.parentNode.getElementsByTagName('label')[0];   
alert(label + ' clicked!');

But the alert box contains:

[object HTMLLableElement] clicked!

if I do label.value then I get:

undefined clicked!

How do I access the label text?

42

Re: Multiple Select Helper plugin

mip wrote:

How do I access the label text?

Got it:

label.firstChild.nodeValue

Re: Multiple Select Helper plugin

what would be done to have a 1 to Many relationship instead ?

Thanks