Get Selected Text from Select Control

This custom formatter works very well. You can use it until Wappler adds it. Of course, it will be much more comfortable to use with the interface :slight_smile:

 dmx.Formatters('string', {
    selectedText: function(val) {
    var e = document.getElementById(val);
    var text=e.options[e.selectedIndex].text;
    return text; 
  }
});

Example Usage :
Be sure to use the ID used for the selectbox.

{{'selectbox_id'.selectedText()}}
3 Likes