Getting the label as a usable value

Getting the label as a usable value

mRendermRender Posts: 151Questions: 26Answers: 13

If I have something like this...

label: "End Time:",
                name: "endingtime",
                type:  "select",
                options: [
                    { label: "7:00 AM", value: 0 },
                    { label: "7:15 AM", value: 15 },
                    { label: "7:30 AM", value: 30 },
                    { label: "7:45 AM", value: 45 },

How would I get the value of the label, not the value of the value?

If I wanted var endtime = editor.field( 'endingtime' ).val(); to be 7:00 AM Instead of 0.

This question has an accepted answers - jump to answer

Answers

  • mRendermRender Posts: 151Questions: 26Answers: 13
    Answer ✓

    Got it!

    var endtime = $('#DTE_Field_endingtime option:selected').text();
    
This discussion has been closed.