javascript - Submit button disabled until another button clicked -


I am making a website for a company to book a vacation for employees. When you put dates, I have a check button and a submit button. I want to disable the submit button until the check button is clicked, but I can not understand how to do this. Any ideas?

These are my form buttons

  & lt; Input type = "reset" value = "reset" & gt; & Lt; Input type = "button" id = "check" name = "check" & gt; & Lt; = "Check" for label & gt; Check & lt; / Label & gt; & Lt; Input type = "submit" id = "submit" value = "submit" & gt;  

And it has so far to me but it does not work ...

  & lt; Script type = "text / javascript" & gt; Var button = $ ("input [type = 'button']"), submitButt = $ ("input [type = 'submit']"); button. Click (function () {submitbutt.attr ("disabled", "button". (": Clicked"));}; & Lt; / Script & gt;  

Try it You can not check "check" on an input that radio Or checkbox is not

  $ (function () {var button = $ ("#cch"), SubmitButt = $ ("# submit"); button. On ("click", function (e) {submitButt.prop ("disabled", incorrect); // NOT toggle});});  

This label does not seem to be understood until you change the input in the checkbox

this

  & Lt; Input type = "button" id = "check" name = "check" value = "check" />  

If you had a checkbox, as it seems, the code may be

  $ (function () {var chkbox = $ ("#quotation"), deposit = $ ("# submit"); chkbox.on ("click", function (e) {submitButt.prop ("disabled",! This.checked); // toggle} );}); Use of  

  & lt; Input type = "checkbox" id = "check" name = "check" & gt; & Lt; Label = "check" & gt; Check & lt; / Label & gt;  

Comments