Hello,
In my members area I have a button that links to a form that allows members to register for an event (not a wix event; it captures data for a database). I'd like to disable this button once the user submits the form once. I'd also like to do the same thing for a file upload button so that once the member uploads the file, the button is disabled or disappears. Thanks in advance.
An OnClick event as others have suggested is technically incorrect as it won't guarantee that the form gets submitted. Instead, you should add the event to the form submission:
Turn on Developer Mode.
Select your Submit button to see what its element name is. In my case, it was button3.
Select the Form itself (click in the empty space beside your form)
In the code view, you'll see the form submit code (your code will be slightly different as your form name will be different as well): export function getSubscribers2_wixFormSubmitted() {
After the { press Enter/Return to create a new line and add: $w('#button3').hide(); making sure to change the '#button3' to whatever your submit button name is.
Publish the changes and test it out. After someone submits the form, the button will disappear and your submit message will appear. Refreshing the page will bring the button back, but that's what you want otherwise it won't appear for the next member. You can likely modify the code further to keep it hidden permanently for that member as long as they're signed in.
A Screenshot of my code:
I'd like to hide the button only if a user enters a certain text, is this possible?
code an onClick event for the button and use the hide function to hide the button
https://www.wix.com/corvid/reference/$w.HiddenMixin.html#hide