how to disable/enable a specific button by jquery ( by name )?
The button does not have ID , just this code:
<button onclick="$('ChangeAction').value='SaveAndDoOrder';" value="Bye" name="SaveAndDoOrder" type="submit">
<i class="Icon ContinueIconTiny"></i>
<span class="SelectedItem">Bye</span>
</button>
I would recommend using ID instead of name, like:
$("#myButton").attr("disabled", true);
This will add the disabled
attribute to the button which your browser will then automaticallly disable. If you want to use name you can use it like this:
$("button[name=myButton]").attr("disabled", true);
Try this:
$("button[name=SaveAndDoOrder]").attr("disabled", "disabled");
That will disable a button with a name
attribute equal to nameOfButton
.
$("button[name=SaveAndDoOrder]").removeAttr("disabled");
That will remove the disable attribute from the same button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With