Disable input if unlimited is checked

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe) 2015-01-28 04:54:00 +01:00
parent 7904946862
commit 00e74a05cb
2 changed files with 18 additions and 0 deletions

View File

@ -573,6 +573,11 @@ input {
border-radius:3px;
}
input[disabled] {
cursor: not-allowed;
background-color: #eee;
}
textarea {
background:#fff url(../img/icons/text_align_left.png) no-repeat 5px 4px;
color: #333;

View File

@ -49,6 +49,19 @@ $(document).ready(function() {
$(".searchtext").val("");
$(".submitsearch").click();
});
// Make inputs with enabled unlimited checked disabled
$("input[name$='_ul']").each(function() {
var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
$("input[name='" + fieldname + "']").prop({
disabled: $(this).is(":checked")
});
});
$("input[name$='_ul']").change(function() {
var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
$("input[name='" + fieldname + "']").prop({
disabled: $(this).is(":checked")
}).focus();
});
// Height of divs fix
var snheight = $('#sidenavigation').height();
var mainheight = $('#maincontent').height();