Hide Add Button on MRVS

gconway
Tera Contributor

I've come across many solutions for removing the "Add" button from the Multi-Row Variable set, but I found this the easiest way. Other solutions hide all "Add" buttons of all MRVS-s on the catalog item, which was no good for me. 

 

1. Create on onLoad Catalog Client Script on the Catalog Item you wish the specific "Add" button hidden. 

2. Look for the ID of the button in the HTML code in console - note it down.

Copy below code:

function onLoad() {
  // MRVS is loaded after the catalog item is loaded. Hence setting a delay of 2 secs.
  setTimeout(function() {
    hideButton();
  }, 2000);
}

function hideButton() {
  var btn = this.document.getElementById("xxxxxxxxxxxxxxxxxxxxx_add_row"); // Replace with the ID of the Add Row button ID seen in the HTML code
  if (btn) {
    btn.style.display = 'none';
  } else {
    console.error("Button element not found.");
  }
}

Hide Add Button MRVS.png

Hope this helps. 

1 REPLY 1

SD_Chandan
Kilo Sage

Hi @gconway ,

If you're not adding multiple rows, there's no need to use MRVS.
Just create normal variables instead — it's simpler and avoids the extra

Thank you
Chandan