Expand my Community achievements bar.

SOLVED

Select Dropdown Val not being submitted on Form Submission

Avatar

Community Advisor

Hi,

 

I have an adaptive form with a select dropdown. I have a JS written which selects an option from the dropdown based on query parameter. E.g (?car=audi will select AUDI from dropdown). The JS is working as expected. On page load it selects the correct option.

 

ISSUE : When I try to submit the form I get a validation error saying 'Please select an item from the dropdown'. Somehow the form is not able to fetch the val for the select. I have printed the val in console and it is coming as expected. I have tried by added .change() to trigger a change in JS. But the same issue persists.

 

Can someone please share some insights on what might be going wrong?

1 Accepted Solution

Avatar

Correct answer by
Employee

Can you try setting the dropdown value in the Initialize event, as below and check:

 

this.value=<string value>;

View solution in original post

3 Replies

Avatar

Employee

Can you share the JS you are using to set the dropdown value?

I tried this at my side on 6.5.10. And I am able to submit the value of the dropdown.

This is my form with dropdown:

Mayank_Tiwari_0-1636622447512.png

 

This is the script I am using to set the dropdown value on initialize: 

Mayank_Tiwari_1-1636622489885.png

 

This is the output I am getting on submitting the form:

Mayank_Tiwari_2-1636622523542.png

 

Avatar

Correct answer by
Employee

Can you try setting the dropdown value in the Initialize event, as below and check:

 

this.value=<string value>;