Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to add/remove disabled attribute in button based on checkbox checked property
    primarykey
    data
    text
    <p>Jquery:</p> <pre><code>&lt;script type="text/javascript"&gt; function enableDisableButton() { var isChecked = ($('input[name=ignore-checkbox]').is(':checked')); if (isChecked == true) { $("button[name=set-up-account]").removeAttr("disabled"); } else { $("button[name=set-up-account]").attr("disabled", "disabled"); } } $('#mobilePage').live('pageinit', function (event) { //document ready for jquery mobile enableDisableButton(); $('#ignore-checkbox').bind("change", function () { enableDisableButton(); }); }); &lt;/script&gt; </code></pre> <p>Html:</p> <pre><code> @using (Html.BeginForm("Account", "SetUpAccount", FormMethod.Post, new { @id = "account-set-up", @data_ajax = "false" })) { &lt;div class="ui-grid-a field"&gt; &lt;div class="ui-block-a" style="width:140px;"&gt; &lt;label for="ignore-checkbox"&gt;Ignore&lt;/label&gt; &lt;input type="checkbox" name="ignore-checkbox" id="ignore-checkbox"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="width:100%;float:left;"&gt; &lt;button type="submit" name="set-up-account" id="set-up-account" data-inline="true" data-mini="true"&gt;Set Up Account&lt;/button&gt; &lt;/div&gt; } </code></pre> <p>I want to enable/disable the <code>Set Up Account</code> button based on check box checked property. If checkbox is checked, then enable the button, else disable. On page load i am disabling the button</p> <p>The problem i am facing is,</p> <p>On page load, its disabling the button, but its not adding/removing the disabled attribute based on change event of check box, i checked in firebug, its entering the loop properly based on checked and unchecked value.</p> <p>Note: I am using Jquery mobile 1.2 and jquery 1.7. Also before posting here i searched in google, there are many postings under enabling and disabling of button based on checkbox checked value. but none solves my issue.</p> <p>What's the problem? please help me</p> <p>Thanks... </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload