Thanks for your reply. That didn’t work for me. I have the form in a repeater so getting a handle to the object was tricky.
Here’s what I ended up doing for anyone who finds this later:
function disable_btn(index){
$('form_name_'+index).submit();
document.getElementById('btn_save_' + index).disabled=true
}
Then my button it looks like this: <button class="btn btn-primary" type="submit" dmx-bind:id="'btn_save_' + $index" dmx-on:click="run({runJS:{function:'disable_btn',args:[$index]}})">Save</button>
Hi,
From what I understand, your repeat will render multiple forms and each form has their own set of controls and buttons. On submission of any 1 of the forms, you want to disable the buttons of that particular form. Is this correct?
I’m opening a modal when a button is clicked and pre-filling some hidden/regular fields. Once the form was submitted I wanted to hide the button.
I ended up passing in the index of the repeater, then used jquery to hide the button after it was saved. I was looking for a more ‘wappler-ish’ way to do this instead of the old-school jquery way but I got it solved.