hi i am currently using umbraco 11 forms i have 5 fields in the forms i would to know if it is possible to disable the submit button or hide the button after it has been clicked and after the user has added their details
And if you want to be more specifically target the Umbraco submit buttons, you can also select them based in their data attribute:
var umbracoSubmitButtons = document.querySelectorAll(input[data-umb='submit-forms-form']);
(I prefer to use vanilla javascript and hardly ever use jQuery anymore). Make sure that all conditions are met before disabling the button obviously. For instance, when someone has not checked the 'consent' checkbox, I guess the form should not submit and you should not disable the button.
hide submit button after it has been clicked
hi i am currently using umbraco 11 forms i have 5 fields in the forms i would to know if it is possible to disable the submit button or hide the button after it has been clicked and after the user has added their details
you could maybe add some javascript to your view to hide/disable it when the button is clicked
hi there is no way to add an onClick attribute to these buttons wanted to add that here i can't even get an ID in these buttons that's my issue
You don't need an id in order to trap an on click using javascript. You can use it's class as the selector. You could do something like this
Wow why was i over thinking this
thank you man appreciate this
Yes, as developers we do tend to overthink things sometimes :D
And if you want to be more specifically target the Umbraco submit buttons, you can also select them based in their data attribute:
(I prefer to use vanilla javascript and hardly ever use jQuery anymore). Make sure that all conditions are met before disabling the button obviously. For instance, when someone has not checked the 'consent' checkbox, I guess the form should not submit and you should not disable the button.
Yeah cool cool man i understand thanks for this info really appreciate it
is working on a reply...