# Hide results until form completion

**URL:** <https://community.elfsight.com/t/hide-results-until-form-completion/48840>\
**Category:** Calculator\
**Tags:** Gathering-Feedback\
**Created:** [April 22, 2024, 10:55pm UTC](https://community.elfsight.com/t/hide-results-until-form-completion/48840 "2024-04-22T22:55:02Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 4, 2025, 7:15am UTC](https://community.elfsight.com/t/hide-results-until-form-completion/48840/11 "2025-04-04T07:15:48Z")

</div>

@Kastri, Here is the solution from our devs:

```auto
const WIDGET_ID = WIDGET ID';
const MESSAGE = 'Place order to see the results';

const style = document.createElement('style');
style.innerHTML = `
  .elfsight-app-${WIDGET_ID} [class*="result-primary__PrimaryContainer-sc"] *,
  .elfsight-app-${WIDGET_ID} [class*="result-secondary__SecondaryContainer-sc"] * {
    display: none;
  }
  .elfsight-app-${WIDGET_ID} [class*="result-primary__PrimaryContainer-sc"]:after,
  .elfsight-app-${WIDGET_ID} [class*="result-secondary__SecondaryContainer-sc"]:after {
    content: '${MESSAGE}';
  }
`;
document.body.append(style);

const waitForElem = (selector) =>
  new Promise((resolve) => {
    if (document.querySelector(selector)) {
      return resolve(document.querySelector(selector));
    }
    const observer = new MutationObserver(() => {
      if (document.querySelector(selector)) {
        observer.disconnect();
        resolve(document.querySelector(selector));
      }
    });
    observer.observe(document.body, {
      childList: true,
      subtree: true,
    });
  });

waitForElem(
  `[class*="${WIDGET_ID}"] [class*="SubmitMessage__Message-sc"]`
).then(() => style.remove());

```

The custom message should be set in the 2nd line of the code.

Replace WIDGET\_ID in the 1st line of the code with [ID of your widget](https://help.elfsight.com/article/1219-where-to-get-your-widget-id-in-new-dashboard) and add the resulted code to the Custom JS field on the Settings tab of your widget’s settings. Try it out and let me know how it worked 🙂

---

_[View the full topic](https://community.elfsight.com/t/hide-results-until-form-completion/48840)._
