Linked Questions

Popular Questions

I'm creating a form in GravityForms and i need to get the text from the selected dropdown option. I have a working jQuery script wich works great. Only issue is that it gives me the value of the selected item instead of the text label.

 var selectHandler = {

    init: function() {

    var select = jQuery('#input_52_2')[0]; //field id to listen
    if(typeof select === 'undefined' || !select) {
        return;
    }

    //Value (before change)
    selectHandler.setEmail.apply( {value: select.value} );

    jQuery(select).on('change', this.setEmail);
},


setEmail: function(ev) {
     jQuery('#input_52_25')[0].value = this.value;
}
};
jQuery().ready( selectHandler.init() );

The result is the value of the selected dropdown item in the input_52_25 field, as expected. What i would like to get is the text from the selected item instead of the value. i've searched a lot and tried different solutions and am a bit stuck now.

Related Questions