Add data attribute to the selected values of a listbox

Add data attribute to the selected values of a listbox

  

Hi,

I have a Listbox (and next to that the Controls/Select2). It works fine.

Now there is a need to add a Data Attribute to each value that is selected. It must be possible to read that value with javascript.

Is that possible?

 

Hi Hans,

can you share more info? For example an oml.

Regards,

António Pereira






Hi Hans,

You could add an extra attribute to the Source Record list on your list box for each record and populate it with whatever other data you need. 

From there, add an on change action to your list box and use the 'RunJavaScript' action from 'HTTPRequestHandler' to pass the value into your javascript (via function/varible etc).

I can give you more specific details if you explain your exact situation.

Thanks,

Justin