- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 07:22 AM
Have requirement to hide 'Order Now' button on service portal on condition.
Written on change client script which work on Native View but not on ServicePortal.
Please suggest how I can make to work on portal
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ch = g_form.getValue('action');
g_form.addInfoMessage(ch);
if(ch==''){
//$('sc_cat_item.no_order_now').hide();
var cart = document.getElementById('order_and_cart_v2');
cart.style.display='none';
}
else if(ch==''){
var carts = document.getElementById('order_and_cart_v2');
carts.style.display='';
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 08:00 AM
Hi,
You can do it using catalog client script and below script
this.document.getElementsByClassName('btn btn-primary btn-block ng-binding ng-scope')[0].style.visibility= 'hidden';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 07:41 AM
Hi,
First thing is that you have the same conditions in if and else if.
Second thing is it not simpler to make this field mandatory so it prevent user from submission?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 06:40 AM
1. If and else condition is not same. It's just I did not shared it.
2. Its not similar to making field mandatory. Need to hide ' Order Now' Button if condition is true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 07:00 AM
Hi,
Can you instead write onSubmit Client Script and prevent submission?
Do you want to hide this button on Portal site ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 07:05 AM
Yes, want to hide button on Portal site.