Bug 16238: Use .prop() instead of .attr() for 'checked'

According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop-
.attr() is no longer correct to access the checked state of a checkbox.

This patch do the following replacements:
  .attr('checked')               =>  .prop('checked')
  .attr('checked, '')            =>  .prop('checked', false)
  .attr('checked, 'checked')     =>  .prop('checked', true)
  .attr('checked', boolValue)    =>  .prop('checked', boolValue)
  .removeAttr('checked')         =>  .prop('checked', false)
  .attr('checked') == 'checked'  =>  .is(':checked')

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Julian Maurice 2016-04-09 07:58:42 +02:00 committed by Kyle M Hall
parent 0b6bc2b598
commit 27770b7c8f
32 changed files with 109 additions and 109 deletions

View File

@ -3,14 +3,14 @@
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
$(".none").click(function(){
if($(this).attr("checked")){
if($(this).prop("checked")){
var rowid = $(this).attr("id");
newid = Number(rowid.replace("none",""))
$("#sms"+newid).removeAttr("checked");
$("#email"+newid).removeAttr("checked");
$("#phone"+newid).removeAttr("checked");
$("#digest"+newid).removeAttr("checked");
$("#rss"+newid).removeAttr("checked");
$("#sms"+newid).prop("checked", false);
$("#email"+newid).prop("checked", false);
$("#phone"+newid).prop("checked", false);
$("#digest"+newid).prop("checked", false);
$("#rss"+newid).prop("checked", false);
}
});
$("#info_digests").tooltip();
@ -75,12 +75,12 @@
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="sms" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% ELSE %]
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="sms" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% END %]
[% END %]
</td>[% END %]
@ -103,12 +103,12 @@
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="phone" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="phone" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% ELSE %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="phone" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="phone" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% END %]
[% END %]
</td>[% END %]
@ -132,12 +132,12 @@
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% ELSE %]
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="email" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% END %]
[% END %]
</td>
@ -164,12 +164,12 @@
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
name="digest" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% ELSE %]
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
name="digest" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% END %]
[% END %]
</td>
@ -188,7 +188,7 @@
<input type="checkbox"
id="rss[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="rss" [% messaging_preference.transport_rss %] onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
value="rss" [% messaging_preference.transport_rss %] onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').prop('checked', false);" />
[% END %]
</td>
[% ELSE %]

View File

@ -345,7 +345,7 @@ function checkBudgetParent(budgetId, newBudgetParent) {
}
function hideColumn(num) {
$("#hideall,#showall").removeAttr("checked").parent().removeClass("selected");
$("#hideall,#showall").prop("checked", false).parent().removeClass("selected");
$("#"+num).parent().removeClass("selected");
var hide = Number(num.replace("col","")) + 2;
// hide header and cells matching the index
@ -353,7 +353,7 @@ function hideColumn(num) {
}
function showColumn(num){
$("#hideall").removeAttr("checked").parent().removeClass("selected");
$("#hideall").prop("checked", false).parent().removeClass("selected");
$("#"+num).parent().addClass("selected");
// set the index of the table column to hide
show = Number(num.replace("col","")) + 2;
@ -365,12 +365,12 @@ function showAllColumns(){
$("#selections").checkCheckboxes();
$("#selections span").addClass("selected");
$("#plan td:nth-child(2),#plan tr th:nth-child(2)").nextAll().show();
$("#hideall").removeAttr("checked").parent().removeClass("selected");
$("#hideall").prop("checked", false).parent().removeClass("selected");
}
function hideAllColumns(){
var allCols = $("#plan th").length;
$("#selections").unCheckCheckboxes();
$("#selections span").removeClass("selected");
$("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns
$("#hideall").attr("checked","checked").parent().addClass("selected");
$("#hideall").prop("checked", true).parent().addClass("selected");
}

View File

@ -6,33 +6,33 @@ $(document).ready(function() {
// Handle the select all/none links for checkouts table columns
$("#CheckAllRenewals").on("click",function(){
$("#UncheckAllCheckins").click();
$(".renew:visible").attr("checked", "checked" );
$(".renew:visible").prop("checked", true);
return false;
});
$("#UncheckAllRenewals").on("click",function(){
$(".renew:visible").removeAttr("checked");
$(".renew:visible").prop("checked", false);
return false;
});
$("#CheckAllCheckins").on("click",function(){
$("#UncheckAllRenewals").click();
$(".checkin:visible").attr("checked", "checked" );
$(".checkin:visible").prop("checked", true);
return false;
});
$("#UncheckAllCheckins").on("click",function(){
$(".checkin:visible").removeAttr("checked");
$(".checkin:visible").prop("checked", false);
return false;
});
// Don't allow both return and renew checkboxes to be checked
$(document).on("change", '.renew', function(){
if ( $(this).is(":checked") ) {
$( "#checkin_" + $(this).val() ).removeAttr("checked");
$( "#checkin_" + $(this).val() ).prop("checked", false);
}
});
$(document).on("change", '.checkin', function(){
if ( $(this).is(":checked") ) {
$( "#renew_" + $(this).val() ).removeAttr("checked");
$( "#renew_" + $(this).val() ).prop("checked", false);
}
});
@ -603,6 +603,6 @@ $(document).ready(function() {
} else {
$( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show();
}
} ).attr( 'checked', false );
} ).prop('checked', false);
}
});

View File

@ -11,7 +11,7 @@ $(document).ready(function() {
/* Function to enable/disable hidden values checkboxes when Flag is (de)selected */
function enable_cb(tab) {
if ($("#hidden_flagged_" + tab).is(':checked')) {
$('.inclusive_' + tab).attr('disabled',true).removeAttr('checked');
$('.inclusive_' + tab).attr('disabled',true).prop('checked', false);
}
else {
$('.inclusive_' + tab).removeAttr('disabled');
@ -132,11 +132,11 @@ function populateHiddenCheckboxes(tab) {
collapsed_checked = true;
} // else if ( hidden_value == '8') { skip }
$("#hidden_opac_" + tab).attr('checked',opac_checked);
$("#hidden_intranet_" + tab).attr('checked',intranet_checked);
$("#hidden_editor_" + tab).attr('checked',editor_checked);
$("#hidden_collapsed_" + tab).attr('checked',collapsed_checked);
$("#hidden_flagged_" + tab).attr('checked',flagged_checked);
$("#hidden_opac_" + tab).prop('checked',opac_checked);
$("#hidden_intranet_" + tab).prop('checked',intranet_checked);
$("#hidden_editor_" + tab).prop('checked',editor_checked);
$("#hidden_collapsed_" + tab).prop('checked',collapsed_checked);
$("#hidden_flagged_" + tab).prop('checked',flagged_checked);
enable_cb(tab);

View File

@ -44,7 +44,7 @@ function build_target_record($sources) {
'code' : subfield
});
} else {
$field_li.find('input.fieldpick').attr('checked', true);
$field_li.find('input.fieldpick').prop('checked', true);
target_record[field] = [{
'id' : $field_li.attr('id'),
'tag' : field,
@ -141,7 +141,7 @@ function rebuild_target($sources, $target) {
$field_clone.find('ul').append($subfield_clone);
}
} else {
$('#' + field.id).find('input.fieldpick').removeAttr('checked');
$('#' + field.id).find('input.fieldpick').prop('checked', false);
}
}
}
@ -155,11 +155,11 @@ $(document).ready(function(){
$('input.fieldpick').click(function() {
var ischecked = this.checked;
if (ischecked) {
$(this).removeAttr('checked');
$(this).prop('checked', false);
if (!field_can_be_added($('#tabs'), $(this).parent())) {
return false;
}
$(this).attr('checked', 'checked');
$(this).prop('checked', true);
}
// (un)check all subfields
@ -173,11 +173,11 @@ $(document).ready(function(){
$("input.subfieldpick").click(function() {
var ischecked = this.checked;
if (ischecked) {
$(this).removeAttr('checked');
$(this).prop('checked', false);
if (!subfield_can_be_added($('#tabs'), $(this).parent())) {
return false;
}
$(this).attr('checked', 'checked');
$(this).prop('checked', true);
}
rebuild_target($('#tabs'), $('#resultul'));
});

View File

@ -8,19 +8,19 @@ function hideColumns(){
valCookie = $.cookie("showColumns");
if(valCookie){
valCookie = valCookie.split("/");
$("#showall").removeAttr("checked").parent().removeClass("selected");
$("#showall").prop("checked", false).parent().removeClass("selected");
for( i=0; i<valCookie.length; i++ ){
if(valCookie[i] !== ''){
index = valCookie[i] - 2;
$("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle();
$("#checkheader"+index).removeAttr("checked").parent().removeClass("selected");
$("#checkheader"+index).prop("checked", false).parent().removeClass("selected");
}
}
}
}
function hideColumn(num) {
$("#hideall,#showall").removeAttr("checked").parent().removeClass("selected");
$("#hideall,#showall").prop("checked", false).parent().removeClass("selected");
valCookie = $.cookie("showColumns");
// set the index of the table column to hide
$("#"+num).parent().removeClass("selected");
@ -56,7 +56,7 @@ Array.prototype.remove = function(from, to) {
};
function showColumn(num){
$("#hideall").removeAttr("checked").parent().removeClass("selected");
$("#hideall").prop("checked", false).parent().removeClass("selected");
$("#"+num).parent().addClass("selected");
valCookie = $.cookie("showColumns");
// set the index of the table column to hide
@ -84,13 +84,13 @@ function showAllColumns(){
$("#selections span").addClass("selected");
$("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show();
$.removeCookie("showColumns", { path: '/' });
$("#hideall").removeAttr("checked").parent().removeClass("selected");
$("#hideall").prop("checked", false).parent().removeClass("selected");
}
function hideAllColumns(){
$("#selections").unCheckCheckboxes();
$("#selections span").removeClass("selected");
$("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide();
$("#hideall").attr("checked","checked").parent().addClass("selected");
$("#hideall").prop("checked", true).parent().addClass("selected");
var cookieString = allColumns.join("/");
$.cookie("showColumns", cookieString, { expires : date, path: '/' });
}
@ -115,7 +115,7 @@ function hideAllColumns(){
});
$("#clearonloanbutton").click(function(){
$("#itemst input[name='itemnumber'][data-is-onloan='1']").each(function(){
$(this).attr('checked', false);
$(this).prop('checked', false);
});
return false;
});
@ -128,7 +128,7 @@ function hideAllColumns(){
hideAllColumns();
e.stopPropagation();
} else {
if($(this).attr("checked")){
if($(this).prop("checked")){
showColumn(num);
} else {
hideColumn(num);

View File

@ -1,10 +1,10 @@
$(document).ready(function() {
$("#CheckAllExports").on("click",function(){
$(".export:visible").attr("checked", "checked" );
$(".export:visible").prop("checked", true);
return false;
});
$("#UncheckAllExports").on("click",function(){
$(".export:visible").removeAttr("checked");
$(".export:visible").prop("checked", false);
return false;
});
@ -72,7 +72,7 @@ $(document).ready(function() {
});
function export_checkouts(format) {
if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
if ($("input:checkbox[name='biblionumbers']:checked").length < 1){
alert(MSG_EXPORT_SELECT_CHECKOUTS);
return;
}
@ -80,9 +80,9 @@ function export_checkouts(format) {
$("input:checkbox[name='biblionumbers']").each( function(){
var input_item = $(this).siblings("input:checkbox");
if ( $(this).is(":checked") ) {
$(input_item).attr("checked", "checked");
$(input_item).prop("checked", true);
} else {
$(input_item).attr("checked", "");
$(input_item).prop("checked", false);
}
} );

View File

@ -104,7 +104,7 @@
}
} );
$("input:checkbox").attr("checked", false);
$("input:checkbox").prop("checked", false);
$("div.biblio.unselected select").attr("disabled", false);
$("div.biblio.unselected input").attr("disabled", false);

View File

@ -28,7 +28,7 @@
updateColumnsVisibility($(this).is(":checked"));
});
$("#show_all_details").attr('checked', false);
$("#show_all_details").prop('checked', false);
updateColumnsVisibility(false);
[% UNLESS ( closedate ) %]
$('#addtoBasket').on('show', function () {

View File

@ -47,7 +47,7 @@
updateColumnsVisibility( $(this).is(":checked") );
});
$("#show_all_details").attr('checked', false);
$("#show_all_details").prop('checked', false);
updateColumnsVisibility(false);
});
//]]>

View File

@ -18,10 +18,10 @@ $(document).ready(function() {
]
}));
$("#show_only_subscription").attr("checked", false);
$("#show_only_subscription").prop("checked", false);
$("#show_only_subscription").click(function(){
if ( $(this).attr("checked") ) {
if ( $(this).prop("checked") ) {
resultst.fnFilter( "1", 0, true );
} else {
resultst.fnFilter( '', 0 );

View File

@ -29,7 +29,7 @@
$("#show_only_renewed").click(function(){
updateRowsVisibility( $(this).is(":checked") );
});
$("#show_only_renewed").attr('checked', false);
$("#show_only_renewed").prop('checked', false);
updateRowsVisibility(false);
$("#advsearch_form").show();

View File

@ -88,10 +88,10 @@
function CheckNItems(n) {
$("input[name='items_to_receive']").each(function() {
$(this).attr('checked', false);
$(this).prop('checked', false);
});
$("input[name='items_to_receive']:lt("+n+")").each(function () {
$(this).attr('checked', true);
$(this).prop('checked', true);
});
}
[% END %]

View File

@ -125,8 +125,8 @@ function delete_contact(ev) {
$('body').on('click', '.delete-contact', null, delete_contact);
$('#add-contact').click(add_contact);
$('body').on('click', '.contact_acqprimary', null, function () {
if ($(this).attr('checked') === 'checked') {
$('.contact_acqprimary').filter(':checked').not(this).removeAttr('checked');
if ($(this).is(':checked')) {
$('.contact_acqprimary').filter(':checked').not(this).prop('checked', false);
$('.contact_acqprimary_hidden').each(function () {
$(this).val('0');
});
@ -134,19 +134,19 @@ function delete_contact(ev) {
$(this).next('.contact_acqprimary_hidden').val('1');
});
$('body').on('click', '.contact_serialsprimary', null, function () {
if ($(this).attr('checked') === 'checked') {
$('.contact_serialsprimary').filter(':checked').not(this).removeAttr('checked');
if ($(this).is(':checked')) {
$('.contact_serialsprimary').filter(':checked').not(this).prop('checked', false);
$('.contact_serialsprimary_hidden').each(function () {
$(this).val('0');
});
}
$(this).next('.contact_serialsprimary_hidden').val($(this).attr('checked') === 'checked' ? '1' : '0');
$(this).next('.contact_serialsprimary_hidden').val($(this).is(':checked') ? '1' : '0');
});
$('body').on('click', '.contact_claimacquisition', null, function () {
$(this).next('.contact_claimacquisition_hidden').val($(this).attr('checked') === 'checked' ? '1' : '0');
$(this).next('.contact_claimacquisition_hidden').val($(this).is(':checked') ? '1' : '0');
});
$('body').on('click', '.contact_claimissues', null, function () {
$(this).next('.contact_claimissues_hidden').val($(this).attr('checked') === 'checked' ? '1' : '0');
$(this).next('.contact_claimissues_hidden').val($(this).is(':checked') ? '1' : '0');
});
});
//]]>

View File

@ -47,7 +47,7 @@
hideAllColumns();
e.stopPropagation();
} else {
if($(this).attr("checked")){
if($(this).prop("checked")){
showColumn(num);
} else {
hideColumn(num);

View File

@ -17,7 +17,7 @@
$("#active").removeAttr('disabled');
$("#hint").html("");
} else {
$("#active").removeAttr('checked');
$("#active").prop('checked', false);
$("#active").attr('disabled','disabled');
$("#hint").html(_("The active currency must have a rate of 1.0"));
}

View File

@ -17,7 +17,7 @@ function clear_edit(){
$(this).removeAttr("disabled");
}
if ( type == "checkbox" ) {
$(this).attr('checked', false);
$(this).prop('checked', false);
}
});
$(edit_row).find("select").removeAttr("disabled");
@ -64,7 +64,7 @@ $(document).ready(function() {
} else if ( i == 12 ) {
// specific processing for cap_fine_to_replacement_price
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
$('#cap_fine_to_replacement_price').attr('checked', cap_fine_to_replacement_price.is(':checked') );
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
$('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
} else {
$(current_column).find("input[type='text']").val(itm);

View File

@ -95,12 +95,12 @@ function verify_images() {
[% IF StaffDetailItemSelection %]
function selectAllItems(div) {
$("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked');
$("input[name='itemnumber'][type='checkbox']", div).prop('checked', true);
itemSelectionBuildActionLinks(div);
}
function clearAllItems(div) {
$("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked');
$("input[name='itemnumber'][type='checkbox']", div).prop('checked', false);
itemSelectionBuildActionLinks(div);
}

View File

@ -204,10 +204,10 @@ function highlightOn() {
}[% END %]
function selectAll () {
$(".selection").attr("checked", "checked");
$(".selection").prop("checked", true);
}
function clearAll () {
$(".selection").removeAttr("checked");
$(".selection").prop("checked", false);
}
function placeHold () {
var checkedItems = $(".selection:checked");

View File

@ -111,8 +111,8 @@ $(document).ready(function(){
// Check all checkboxes in first tab, and uncheck all others to avoid
// inconsistencies from a page refresh.
$('#tabs div#tabrecord[% ref_biblionumber %]').find('input[type="checkbox"]').attr('checked', true);
$('#tabs > div:not("#tabrecord[% ref_biblionumber %]")').find('input[type="checkbox"]').removeAttr('checked');
$('#tabs div#tabrecord[% ref_biblionumber %]').find('input[type="checkbox"]').prop('checked', true);
$('#tabs > div:not("#tabrecord[% ref_biblionumber %]")').find('input[type="checkbox"]').prop('checked', false);
//Set focus to cataloging search
$("input[name=q]:eq(0)").focus();

View File

@ -64,7 +64,7 @@ columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues
// On-site checkout
function toggle_onsite_checkout(){
if ( $("#onsite_checkout").attr('checked') ) {
if ( $("#onsite_checkout").prop('checked') ) {
$("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]")
[% IF !Koha.Preference('SpecifyDueDate') %]
$("#duedatespec").datetimepicker('destroy');
@ -120,7 +120,7 @@ $(document).ready(function() {
$('#table_borrowers tbody tr').removeClass('selected');
$(this).addClass('selected');
if (event.target.type !== 'radio') {
$(':radio', this).attr('checked', 'true')
$(':radio', this).prop('checked', 'true')
}
});

View File

@ -103,7 +103,7 @@ $(document).ready(function () {
$("#barcode").focus();
});
[% IF(overduecharges) %] $("#barcode").focus(function () {
if (($("#exemptcheck").attr("checked") == true) || ($("#dropboxcheck").attr("checked") == true)) {
if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
$("#barcode").addClass("alert");
} else {
$("#barcode").removeClass("alert");

View File

@ -18,7 +18,7 @@
$('input[name="flag"]').each(function() {
if($(this).attr('id') != "flag-0"){
$(this).attr('disabled', 'disabled');
$(this).removeAttr('checked', 'checked');
$(this).prop('checked', false);
}
});
}
@ -28,7 +28,7 @@
$('input[name="flag"]').each(function() {
if($(this).attr('id') != "flag-0"){
$(this).attr('disabled', 'disabled');
$(this).removeAttr('checked', 'checked');
$(this).prop('checked', false);
}
});
}

View File

@ -1102,15 +1102,15 @@ function select_user(borrowernumber, borrower) {
var transports = ['email', 'rss', 'sms'];
$.each(transports, function(j, transport) {
if (item['transports_' + transport] == 1) {
$('#' + transport + attrid).attr('checked', 'checked');
$('#' + transport + attrid).prop('checked', true);
} else {
$('#' + transport + attrid).removeAttr('checked');
$('#' + transport + attrid).prop('checked', false);
}
});
if (item.digest && item.digest != ' ') {
$('#digest' + attrid).attr('checked', item.digest);
$('#digest' + attrid).prop('checked', true);
} else {
$('#digest' + attrid).removeAttr('checked');
$('#digest' + attrid).prop('checked', false);
}
if (item.takes_days == '1') {
$('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);

View File

@ -24,16 +24,16 @@
});
var selectFieldNames = ["field_1","field_2","field_3"];
for (var i=0; i < selectFieldNames.length; i++) {
Go($("#"+selectFieldNames[i]+"_enable").attr("checked"), selectFieldNames[i]+"_select");
Go($("#"+selectFieldNames[i]+"_enable").prop("checked"), selectFieldNames[i]+"_select");
}
$("#field_1_enable").change(function(){
$(".field_1_enable").html(Go($(this).attr("checked"), 'field_1_select'));
$(".field_1_enable").html(Go($(this).prop("checked"), 'field_1_select'));
});
$("#field_2_enable").change(function(){
$(".field_2_enable").html(Go($(this).attr("checked"), 'field_2_select'));
$(".field_2_enable").html(Go($(this).prop("checked"), 'field_2_select'));
});
$("#field_3_enable").change(function(){
$(".field_3_enable").html(Go($(this).attr("checked"), 'field_3_select'));
$(".field_3_enable").html(Go($(this).prop("checked"), 'field_3_select'));
});
$("#barcode_print").load(barcode_text('barcode_param'));
$("#barcode_print").change(function(){
@ -41,11 +41,11 @@
});
function barcode_text(division) {
var eBarcode = document.getElementById(division);
if( $("input[name=barcode_print]:checked").attr("checked") ) {
if( $("input[name=barcode_print]:checked").prop("checked") ) {
eBarcode.style.display = 'block';
} else {
eBarcode.style.display = 'none';
$('input[name=barcode_text_print]').removeAttr('checked');
$('input[name=barcode_text_print]').prop('checked', false);
}
}
function getUnit(unit){

View File

@ -13,7 +13,7 @@
$("#deldateTo").attr('disabled', false);
} else {
$("#removeddatetr").hide();
$("input[value='deleteditems.timestamp']").attr('disabled', true).attr('checked', false);
$("input[value='deleteditems.timestamp']").attr('disabled', true).prop('checked', false);
$("#deldateFrom").attr('disabled', true).val('');
$("#deldateTo").attr('disabled', true).val('');
}

View File

@ -182,12 +182,12 @@ $("#delColumn").on("click",function(){
[% IF (create || editsql || save) %]
$("#select_group").change(function() {
if($(this).attr('checked')) {
if($(this).prop('checked')) {
$("#group_input").attr('disabled', 'disabled');
$("#groupdesc_input").attr('disabled', 'disabled');
$("#group_select").attr('disabled', false);
if ($("#group_select").val().length > 0) {
$("#select_subgroup").attr('checked', 'checked');
$("#select_subgroup").prop('checked', true);
$("#select_subgroup").change();
$("#subgroup, #subgroup *").show();
} else {
@ -196,11 +196,11 @@ $("#delColumn").on("click",function(){
}
});
$("#create_group").change(function() {
if($(this).attr('checked')) {
if($(this).prop('checked')) {
$("#group_input").attr('disabled', false);
$("#groupdesc_input").attr('disabled', false);
$("#group_select").attr('disabled', 'disabled');
$("#create_subgroup").attr('checked', 'checked').change();
$("#create_subgroup").prop('checked', true).change();
$("#subgroup_select").hide();
$("#subgroup input[type='radio']").hide();
$("#subgroup label[for]").hide();
@ -210,14 +210,14 @@ $("#delColumn").on("click",function(){
}
});
$("#select_subgroup").change(function() {
if($(this).attr('checked')) {
if($(this).prop('checked')) {
$("#subgroup_select").attr('disabled', false);
$("#subgroup_input").attr('disabled', 'disabled');
$("#subgroupdesc_input").attr('disabled', 'disabled');
}
});
$("#create_subgroup").change(function() {
if($(this).attr('checked')) {
if($(this).prop('checked')) {
$("#subgroup_input").attr('disabled', false);
$("#subgroupdesc_input").attr('disabled', false);
$("#subgroup_select").attr('disabled', 'disabled');

View File

@ -41,7 +41,7 @@ $(document).ready(function() {
$('#table_borrowers tbody tr').removeClass('selected');
$(this).addClass('selected');
if (event.target.type !== 'radio') {
$(':radio', this).attr('checked', 'true')
$(':radio', this).prop('checked', 'true')
}
});
var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
@ -153,7 +153,7 @@ function checkMultiHold() {
$("#requestany").click(function() {
if(this.checked){
$("input[name=checkitem]").each(function() {
$(this).removeAttr("checked");
$(this).prop("checked", false);
});
}
});
@ -165,9 +165,9 @@ function checkMultiHold() {
}
});
if(onechecked == 1){
$("#requestany").removeAttr("checked");
$("#requestany").prop("checked", false);
} else {
$("#requestany").attr("checked","checked");
$("#requestany").prop("checked",true);
}
});

View File

@ -29,7 +29,7 @@
$("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
$("#CheckAll").click(function() {
$("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
$("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
});
// Generates a dynamic link for exporting the selections data as CSV

View File

@ -10,13 +10,13 @@
<script type="text/javascript">
//<![CDATA[
function Check_boxes(dow) {
if($(":checkbox[data-dow='"+dow+"']:first").attr("checked") == 'checked') {
if($(":checkbox[data-dow='"+dow+"']:first").is(':checked')) {
$("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
$(this).attr('checked', true);
$(this).prop('checked', true);
});
} else {
$("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
$(this).attr('checked', false);
$(this).prop('checked', false);
});
}
}

View File

@ -36,7 +36,7 @@ $(document).ready(function() {
$(".records input:checkbox[data-issues!='0']").each(function(){
$(this).attr('title', MSG_CANNOT_BE_DELETED)
$(this).attr('disabled', true);
$(this).attr('checked', false);
$(this).prop('checked', false);
$(this).parents('tr').find('td').css('background-color', '#ffff99');
});
[% END %]

View File

@ -27,13 +27,13 @@
}));
$("#selectallbutton").click(function() {
$("#borrowerst").find("input:checkbox").each(function() {
$(this).attr("checked", true);
$(this).prop("checked", true);
});
return false;
});
$("#clearallbutton").click(function() {
$("#borrowerst").find("input:checkbox").each(function() {
$(this).attr("checked", false);
$(this).prop("checked", false);
});
return false;
});