• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

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

Back
Top