Skip to main content
viren_pushpanay
Level 2
October 16, 2015
Solved

How do I programmatically (in a JSP) set as 'selected' an item in a dropdown?

Hi,

How do I programmatically (in a JSP) set as 'selected' an item in a dropdown? Following is my code. 

<cq:include path="./country" resourceType="foundation/components/form/dropdown" />

I have a list of countries in the dropdown and want a country to be selected based on a value passed to the JSP.

Thank you.

Cheers,

Viren.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

You can extend the component and add a method to set the dropdown based on value that you pass to it. All components are just JavaScript code. 

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

You can extend the component and add a method to set the dropdown based on value that you pass to it. All components are just JavaScript code. 

Translate