Do I have any ideas that can not help in disabling the submit button any ideas?
& lt; Input type = "checkbox" check = "checked" id = "check" & gt; & Lt; A href = "#" & gt; Terms and Conditions & lt; / A & gt; & Lt; Input type = "submit" id = "postme" value = "submit" & gt; $ ('#cch'). Click (function () ($ (this ($ (checked) == incorrect) {$ ('# postme'). Attr ("disabled", "disabled");} and {$ ('# post' ) Removed attribute ('disabled');}});
Checked should be checked and not the method. Updated Bella:
$ ('#cch') Click (function } {If ($ (this) .attr ('checked') == incorrect) {$ ('# postme') etter ("disabled", "disabled");} and {$ ('# postmay'). Gone at ('disabled');}}); edit Remember that The code should be wrapped inside $ .dir file. Or enter it in the lower part of your HTML code, otherwise your JS will link itself to the DOM elements that are not yet loaded. wrapping it .ready () script type = 'text / javascript' & gt; $ (Document) .ready (function () {$ ('# checky'). Click (function () {if ($ (this) .attr ('checked') == false) {$ ('# postme' ) .attr ("disabled", "disabled");} and {$ ('# postmay'). RemoveAttr ('disabled');}});}); & Lt; / Script & gt; This code can be placed anywhere in the document and will be triggered only after the dome is created so that you do not have to worry about triggering prematurely.
Putting it at the bottom of your document If you are keeping it under your document, you do not need to wrap it in .ready () because Javascript will not work until everything Read until loaded. A demonstration has been promoted in this method (if you have a lot of JS) You can use one of these methods to make sure that your JS handling methods Only added the DOM elements later they have finished loading
Comments
Post a Comment