Contents
1.1 To disable a submit button, you just need to add a disabled attribute to the submit button. $(“#btnSubmit”). attr(“disabled”, true); 1.2 To enable a disabled button, set the disabled attribute to false, or remove the disabled attribute.
Disable a button for 30 seconds
- Thanks everyone.
- window.onload = function() { var btn = document.getElementsByName(‘submit’)[0]; btn.disabled = true; setTimeout(function(){btn.disabled = false;}, 30000); }; – user3270936 Feb 4 ’14 at 14:10.
How disable submit button after click in MVC?
Disable razor form submit button when clicked
- Set a form id in Html.BeginForm()
- The javascript to submit the form needs a form id.
- @using (Html.BeginForm(null, null, FormMethod.Post, new {id=”idMyForm”})) {
- Use javascript to disable the button and then submit the form.
– Set an array with IDs of the buttons (one or more IDs), then call the disableEnableBtn() function, passing the array as argument. To change the time after which the button is enabled, modify the value of 2000 added in setTimeout() ; see also the comments in code. – Example with two buttons.
On each button click, set the currentLesson value to ‘number’/ order of the button, i.e. for the first button, it will be ‘1’, for the second ‘2’ and so on. Each button now can be disabled with [disabled] attribute, if it the currentLesson is not the same as it’s order.
How to disable the image link on click?
From your question, it sounds like your “button” is the image that you click on…if that’s true then you can use the following: On click, remove the href attribute from the a element.
If you want to pass the button value, use attr (‘onclick’,’this.style.opacity = “0.6”; return false;’) instead. If when you set disabled=”disabled” immediately after the user clicks the button, and the form doesn’t submit because of that, you could try two things:
And after first clicking change the value of your state variable isDisable = true. Instead of using RaisedButton directly, you can turn it into a StatefulWidget. Then use the ChangeNotifier to change it state from enable to disable and control button press function.It will also help you to reuse it in different places.
How to disable button after clicking worker portal menu?
On click of the button what would be the action, if any action invoked on click , set a flag and use that flag for visible condition for the button and make sure check the box “run on client’. Note: If u want to show the button again make sure to reset the flag. How if I want to disable button in case worker portal menu?