How to add new dropdown value based on another text field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 03:27 AM
Hello All,
I have a dropdown field which is select box in catalog form. When user enters a new value in Text field that value has to be added as new dropdown option in dropdown field. How to achieve this further?
Ex: Locations is a select box field with few options.
There is a Text box field called ID, and when user fills this ID field the value needs to be updated as dropdown field of Location.
Kindly help me with this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 03:55 AM
please refer this thread :-
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 04:42 AM
You can create a on change client script on Id field which will add option to location field dynamically
Sample code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue != "") {
var inputValue = g_form.getValue('ID'); //enter id field name
g_form.addOption("location_field_name",inputValue,inputValue); //enter location field name
}
}