How to code in java to get checkboxes not value but label?

I use for an element javascript code, action: load

Here is a piece of this code
JavaScript:
var tocs = Fabrik.getBlock('form_320').formElements.get('ccjom_cc_kk_karta_rejestr___is_dodatkowe2').getValue();
$('ccjom_cc_kk_karta_rejestr___dd_tocs').value = tocs;


is in fabrik a way to get for:
var tocs_label = Fabrik.getBlock('form_320').formElements.get('ccjom_cc_kk_karta_rejestr___is_dodatkowe2').getValue();

not Value of checkbox but labels?
How to code:
var tocs = Fabrik.getBlock('form_320').formElements.get('ccjom_cc_kk_karta_rejestr___is_dodatkowe2').get---Labels---();
/
 
Unfortunately not easily, no. Checkboxes in HTML don't really have "labels", it's just text rendered next to the input field. We wrap checkboxes in a label tag, which you could get the text attribute for, like ...

Code:
Fabrik.getBlock('form').formElements.get('fab_junk___chbox').element.getElements('label')[0].get('text')

... but of course you'd need to iterate through all the subelements, find the ones which are selected, and get the label text for just those. Like I said, not easy.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top