jQuery Combobox Selecting text

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
igimanigi
Posts: 11
Joined: 2016-11-30 18:24

jQuery Combobox Selecting text

Post by igimanigi » 2016-12-15 15:00

Hi guys,
How can i get the text of the selected value in a combobox using jQuery. I have tried the following and its not working;

jQuery('#fieldname-container option:selected').text();

I am using appgini 5.51

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: jQuery Combobox Selecting text

Post by DevGiu » 2016-12-18 10:58

You get the object this way:
$j('#yourfield-container').select2('data')

If you want directly the text:
$j('#yourfield-container').select2('data').text
/Giuseppe
Professional Outsourcing Services

hbcornea
Posts: 3
Joined: 2017-01-12 07:54

Re: jQuery Combobox Selecting text

Post by hbcornea » 2017-01-16 08:12

Hi,

Can I ask where to add this codes?

Post Reply