• Resolved wilfried1954

    (@wilfried1954)


    I need to have the selected item, or itemindex or selected value of a dropdown.

    Tryed this:
    var aantalKids = jQuery('[id*="fieldname2_"]').val();

    But seems not to work.

    Can you give the right info?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @wilfried1954

    To get the value of DropDown field, you simply should to include var aantalKids = fieldname2; as part of the equation associated to the calculated field:

    
    (function(){
    var aantalKids = fieldname2;
    
    /** The rest of the equation's code here **/
    })()
    

    Best regards

    Thread Starter wilfried1954

    (@wilfried1954)

    Sorry I was not clear. I try to get the value of it in an onclick event of a button.

    Plugin Author codepeople

    (@codepeople)

    Hello @wilfried1954

    Please, use the piece of code:

    
    var aantalKids = jQuery('[id*="fieldname2_"] option:selected').attr('value');
    

    Best regards.

    Thread Starter wilfried1954

    (@wilfried1954)

    Thank you. This works perfect. Have a nice weekend, Wilfried

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get itemindex or value of a dropdown’ is closed to new replies.