Only enable the [add] button when boxes are checked.

This commit is contained in:
Bharat Mediratta
2009-07-02 11:49:45 -07:00
parent a619bb8196
commit d4075a4657
2 changed files with 12 additions and 2 deletions

View File

@@ -41,6 +41,14 @@ function click_node(checkbox) {
var parent = $(checkbox).parents("li").get(0);
var checked = $(checkbox).attr("checked");
$(parent).find("input[type=checkbox]").attr("checked", checked);
if ($("#gServerAddTree").find("input[type=checkbox]").is(":checked")) {
$("#gServerAddAddButton").attr("disabled", true);
$("#gServerAddAddButton").removeClass("ui-state-disabled");
} else {
$("#gServerAddAddButton").attr("disabled", false);
$("#gServerAddAddButton").addClass("ui-state-disabled");
}
}
/* ================================================================================ */

View File

@@ -25,8 +25,10 @@
</ul>
<span>
<?= form::submit(array("id" => "gServerPauseButton", "name" => "add", "disabled" => true, "class" => "submit", "style" => "display:none"), t("Pause")) ?>
<?= form::submit(array("id" => "gServerAddButton", "name" => "add", "disabled" => true, "class" => "submit"), t("Add")) ?>
<input id="gServerAddPauseButton" class="submit ui-state-disabled" disabled="disabled" type="submit"
value="<?= t("Pause") ?>" style="display: none">
<input id="gServerAddAddButton" class="submit ui-state-disabled" disabled="disabled" type="submit"
value="<?= t("Add") ?>">
</span>
<?= form::close() ?>
<div class="gProgressBar" style="visibility: hidden" ></div>