How to update Multiple choice field based on Single text field having Client Script Floating Validat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 12:30 PM
How to update Multiple choice field based on Single text field having Client Script Floating Validation in Catalog Item?
If Single Text Floating field is less than 500 option1 to be selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 12:56 PM
Hello @VIKASM535239375
Did the catalog client script not working ? Are you showing or hiding options as well ?
Can you share screenshot of what you have done until now ?
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 01:24 PM
Hello @VIKASM535239375 ,
There you go. Please just put in your own variable and option names.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearValue('multiple_choice_field');
if (newValue < 500) {
g_form.setValue('multiple_choice_field', 'option1');
} else if (newValue > 500) {
g_form.setValue('multiple_choice_field', 'option2');
}
}
The script will not select any option when the input is not a number, or if the user entered the exact number 500, which is excluded in your requirement but that may be by mistake.
Regards,
Robert