How to access the selected value of a dropdown list (enumeration list) in a input form | Community
Skip to main content
Level 2
December 26, 2019
Solved

How to access the selected value of a dropdown list (enumeration list) in a input form

  • December 26, 2019
  • 2 replies
  • 2400 views

Hi Experts,

I have data schemas A & B, schema B has an element with type="link", name="dropdownlist" and target="A".

Also i have input form F. F displays a dropdown list with input element with xpath="dropdownlist" .

 

Question: How can I access the selected value of my 'dropdownlist' input field in below scenarios:

a). access the selected value of 'dropdownlist' in the same input form F from another referral input field

b). access the selected value of 'dropdownlist' from a javascript activity?

 

Good Day!

Nigel,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

Hi,

 

a) Put referral input field in a popup form/wizard and use <enter/> or <leave/> event to set it from dropdownlist field.

b) Use <soapCall/> to send the field to a schema-defined SOAP endpoint, with JS as the consumer.

 

Thanks,

-Jon

2 replies

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
December 30, 2019

Hi,

 

a) Put referral input field in a popup form/wizard and use <enter/> or <leave/> event to set it from dropdownlist field.

b) Use <soapCall/> to send the field to a schema-defined SOAP endpoint, with JS as the consumer.

 

Thanks,

-Jon

Level 2
October 28, 2023

Hello Nigel,

Accessing the selected value of your 'dropdownlist' input field in the described scenarios can be achieved as follows:

a). To access the selected value of 'dropdownlist' in the same input form F from another referral input field, you can use JavaScript. Assuming you want to update another input field with the selected value:

 

// Get the dropdownlist element
var dropdownlist = document.querySelector("input[name='dropdownlist']");

// Get the selected value
var selectedValue = dropdownlist.value;

// Now you can use the 'selectedValue' to update another input field or perform any other action.

 

b). To access the selected value of 'dropdownlist' from a JavaScript activity, you can use the same approach within your JavaScript code:

// Get the dropdownlist element
var dropdownlist = document.querySelector("input[name='dropdownlist']");

// Get the selected value
var selectedValue = dropdownlist.value;

// You can then use 'selectedValue' within your JavaScript activity as needed.

These code snippets should help you access the selected value from the 'dropdownlist' input field in both scenarios. If you have more specific requirements or need further assistance, please provide additional details. Good day! 🌞👍

Best regards,
David Mitchell