Make dropdown opton selected by using jQuery?

  • Profile Image
    visioneyeinstitute
    Asked on August 30, 2017 at 01:48 AM

    Hi there,

    We are pre populating a select with our form using jquery. We can identify the iframe, the form and target the desired select and put what option we want to selected. What we can't do is make the select form physically active which triggers the conditional logic for the rest of the form. 

    We've tried everything and the only thing left is to perhaps have some custom script installed on the form itself - is this possible?

     

    Cheers

     

    NK

     

  • Profile Image
    Nik_C
    Answered on August 30, 2017 at 03:11 AM

    Unfortunately, it is not possible to add any script code to our form. I assume you used Full Source Code to populate the drop-down?

    Did you try using the value option?

    $("select#elem").val('0'); 

    I found these forum guides:

    https://stackoverflow.com/questions/1314245/set-the-selected-index-of-a-dropdown-using-jquery

    Or maybe this one: 

    https://stackoverflow.com/questions/17856523/how-to-set-the-selected-option-of-a-select-dropdown-list-with-jquery

    If you have any further concerns please let us know.

    Thank you!