Form onChange for all elements?

According to the documentation: doku.php?id=dhtmlxform:event_onchange
it states that “Event works for constructed input elements only”. However, there are more form elements other than input - textarea, select, checkboxes, option …
The parameters are
an item id
an item value
a checked state

For a select element the bound value is passed - what can you do to read the text of the selection?

Input elements are the next: text, select, password, file, combo, calendar, colorpicker.

I suggest you use the next approach:


html,body { height: 100%; margin: 0px; overflow: hidden; }

Hi, Thanks for the response. As it didn’t answer my question then maybe I’ll try again. Your solution has the text and value the same. My question was “how to access the text portion of the select?”

There are times that when you use the value for internal processing (eg. database queries) but send a confirmation advisory to the user - “Hi, thank you for selecting AC3”

After a bit more digging I found that the ‘problem’ had been solved elsewhere.

... {type: "select", label: "Format", name: "format", options:[ {text: "AAC", value: "0"}, {text: "AC3", value: "1", selected: true}, {text: "MP3", value: "2"}, ... myForm.attachEvent("onChange",function(id, value){ var opts = myForm.getOptions("format"); alert(opts[opts.selectedIndex].text); ...