Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

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

Avatar

Level 2

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,

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2

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