如何在重力形式中创建一个切换按钮,在wordpress中从Open打开到关闭时会冻结?

I'have created a form using gravity forms plugin in WordPress in which I want to have a toggle button like this below:

enter image description here

When the button is set to close it should never get set open. Can any one help me out with this I ' m new to wordpress I dont know how to do it using wordpress and I have an addon of gravity form that is gravity view that must show the output in that view that it is open or closed. Thank You !

You can disable the button with the following code:

const btn = document.getElementById('test'); // use your button/input id here
btn.addEventListener('click', () => {
    if (!btn.disabled) {
        btn.disabled = true;
    }
});