- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 12:31 AM
Have Choice Field 'price' . If price - option 'A ' is selected displaying another field 'Cause', using an UI policy.
On change of Price, If option A is selected, Cause should be visible and have to show a field message. If Price is 'option B', display Cause and show another field message.
created on change client script for 'price' . But the field message for option A is causing the form to jump to the top. How can we avoid this?
Here is the code tried on Change of Price
if (price == 'option A') {
g_form.hideFieldMsg('u_cause', true);
g_form.showFieldMsg('u_cause', 'unique product', 'info');
} else if (price == 'option B') {
g_form.hideFieldMsg('u_cause', true);
g_form.showFieldMsg('u_cause', 'only one product available', 'info');
}
for Option B form stays as it is but when selected option A , form jumps to the top
Appreciate the Help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 01:32 AM
Hi @SAS21 ,
Please try to use below format to prevent form from Scrolling
g_form.showFieldMsg('<FIELD_NAME>', '<MESSAGE>', 'info', false);
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 01:32 AM
Hi @SAS21 ,
Please try to use below format to prevent form from Scrolling
g_form.showFieldMsg('<FIELD_NAME>', '<MESSAGE>', 'info', false);
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 01:41 AM - edited 09-09-2024 01:44 AM
Hi @SAS21 ,
Please try below script this will help you
Please create the onChange client script on particular values for example in your case price
alert("va = " + newValue);
if (newValue == 'option_a') {//backend value of option_a
g_form.hideFieldMsg('u_cause', true);
g_form.showFieldMsg('u_cause', 'Unique Product', 'info');
} else if (newValue == 'option_b') {//backend value of option_b
g_form.hideFieldMsg('u_cause', true);
g_form.showFieldMsg('u_cause', 'Only one product available', 'info');
}else{
g_form.hideFieldMsg('state', true);
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak