Fetch value from Select and Checkbox fields in suitelet

For the custom SELECT fields and CHECKBOX fields, sometimes we cannot fetch the data directly using their id from suitelet.

Solution:

Inspect and check the structure of the field.

Sometimes, the select element you’re trying to access is actually a custom dropdown or a select field wrapped inside a more complex HTML structure, possibly generated by a UI framework. The value you’re trying to retrieve might not be in the traditional <select> tag but rather in an input tag that manages the dropdown’s value. The key is to target the correct element that holds the value you’re looking for.

Find out the id of the field id and use it.

For select fields,

document.

getElementById

(

‘hddn_custpage_jj_status1’

).value

For checkbox

document.

getElementById

(

‘custpage_jj_status1’

).checked

Leave a comment

Your email address will not be published. Required fields are marked *