* @return
*/
function toggleCheckboxVals(fldPrefix, object) {
- if (object.id == 'toggleSelect' && cj(object).is(':checked')) {
- cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', true);
- }
- else {
- cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', false);
- }
+ var val = (object.id == 'toggleSelect' && cj(object).is(':checked'));
+ cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').prop('checked', val);
// change the class of selected rows
on_load_init_checkboxes(object.form.name);
}
*/
function checkSelectedBox(chkName) {
var checkElement = cj('#' + chkName);
- if (checkElement.attr('checked')) {
- cj('input[value=ts_sel]:radio').attr('checked', true);
+ if (checkElement.prop('checked')) {
+ cj('input[value=ts_sel]:radio').prop('checked', true);
checkElement.parents('tr').addClass('crm-row-selected');
}
else {
if ( operation == 'release' ) {
data['operation'] = operation;
data['activity_id'] = cj( element ).val( );
- data['isDelete'] = cj( element ).attr( 'checked') ? 1:0;
+ data['isDelete'] = cj( element ).prop('checked') ? 1:0;
} else if ( operation == 'reserve' ) {
var interviewerId = cj( '#survey_interviewer_id' ).val( );
data['operation'] = operation;
data['target_contact_id'] = cj( element ).val( );
data['source_contact_id'] = interviewerId;
data['assignee_contact_id'] = interviewerId;
- data['isReserved'] = cj( element ).attr( 'checked') ? 1:0;
+ data['isReserved'] = cj( element ).prop('checked') ? 1:0;
} else if ( operation == 'gotv' ) {
data['operation'] = operation;
data['activity_id'] = cj( element ).val( );
- data['hasVoted'] = cj( element ).attr( 'checked') ? 1: 0;
+ data['hasVoted'] = cj( element ).prop('checked') ? 1: 0;
}
data['surveyTitle'] = {/literal}'{$surveyTitle|escape:javascript}'{literal};
cj( msgId ).fadeIn('slow').fadeOut('slow');
if ( operation == 'release' ) {
msg = '{/literal}{ts escape='js'}Save as voted.{/ts}{literal}';
- var isDeleted = cj( element ).attr( 'checked') ? 1:0;
+ var isDeleted = cj( element ).prop('checked') ? 1:0;
if ( !isDeleted ) msg = '{/literal}{ts escape='js'}Save as non voted.{/ts}{literal}';
} else if ( operation == 'gotv' ) {
msg = '{/literal}{ts escape='js'}Vote Recorded.{/ts}{literal}';
- var hasVoted = cj( element ).attr( 'checked') ? 1:0;
+ var hasVoted = cj( element ).prop('checked') ? 1:0;
var trObject = cj( '[id^="survey_activity['+ cj( element ).val() +']"]' ).parents('tr' );
var methodName = 'addClass';
if ( !hasVoted ) {
}
eval( 'trObject.' + methodName + "( 'name disabled' )" );
} else if ( operation == 'reserve' ) {
- if ( cj( element ).attr( 'checked') ) {
+ if ( cj( element ).prop('checked') ) {
msg = '{/literal}{ts escape='js'}Reserved.{/ts}{literal}';
} else {
msg = '{/literal}{ts escape='js'}Released.{/ts}{literal}';
}
if ( result[key].is_default == 1 ) {
- cj('#radio'+countRows+' input').attr('checked', 'true');
+ cj('#radio'+countRows+' input').prop('checked', true);
}
if ( countRows > 1 ) {
switch ( element['1'] ) {
case 'addressee':
- var ele = '#' + element['0'] + '_' + element['1'];
+ ele = '#' + element['0'] + '_' + element['1'];
break;
case 'email':
case 'postal':
- var ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
+ ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
break;
}
if( ele ) {
- cj(this).bind( 'click', function() {
-
- if( cj( this).attr( 'checked' ) ){
- cj('input' + ele ).attr('checked', true );
- cj('input' + ele + '_custom' ).attr('checked', true );
- } else {
- cj('input' + ele ).attr('checked', false );
- cj('input' + ele + '_custom' ).attr('checked', false );
- }
+ cj(this).on('click', function() {
+ var val = cj(this).prop('checked');
+ cj('input' + ele + ', input' + ele + '_custom').prop('checked', val);
});
}
});
cj('.pagerDisplay').on('click', '.contact_select input', function () {
var valueSelected = cj(this).val();
- if ( cj(this).attr('checked') ) {
+ if ( cj(this).prop('checked') ) {
contact_checked[valueSelected] = valueSelected;
countSelected++;
} else if( contact_checked[valueSelected] ) {
delete contact_checked[valueSelected];
countSelected--;
if ( useEmployer && employer_holdelement[valueSelected] ) {
- cj( employer_holdelement[valueSelected] ).attr('checked',false);
+ cj( employer_holdelement[valueSelected] ).prop('checked',false);
delete employer_checked[valueSelected];
delete employer_holdelement[valueSelected];
}
if ( isRadio ) {
employer_checked = new Array();
}
- if ( cj(this).attr('checked') ) {
+ if ( cj(this).prop('checked') ) {
// add validation to match with selected contacts
if( !contact_checked[valueSelected] ) {
cj(this).crmError({/literal}'{ts escape="js"}Current employer / Current employee should be among the selected contacts.{/ts}'{literal});
- cj(this).attr('checked',false);
+ cj(this).prop('checked',false);
} else {
employer_checked[valueSelected] = valueSelected;
employer_holdelement[valueSelected] = this;
function checkSelected( ) {
cj('.pagerDisplay tbody tr .contact_select input').each( function( ) {
if ( contact_checked[cj(this).val()] ) {
- cj(this).attr('checked',true);
+ cj(this).prop('checked',true);
}
});
employer_holdelement = new Array();
cj('.pagerDisplay tbody tr .'+ employerClass +' input').each( function( ) {
if ( employer_checked[cj(this).val()] ) {
- cj(this).attr('checked',true);
+ cj(this).prop('checked',true);
employer_holdelement[cj(this).val()] = this;
}
});
{/literal} {if $searchRows} {literal}
cj(".contact_select .form-checkbox").each( function( ) {
if (this) {
- cj(this).attr('checked',true);
+ cj(this).prop('checked',true);
}
});
{/literal} {/if} {literal}
cj.post( Url, { qfKey: qfKey , variableType: 'multiple' , action: 'unselect' } );
{/literal}
{foreach from=$rows item=row}{literal}
- cj("#{/literal}{$row.checkbox}{literal}").removeAttr('checked');{/literal}
+ cj("#{/literal}{$row.checkbox}{literal}").prop('checked', false);{/literal}
{/foreach}
{literal}
- cj("#toggleSelect").removeAttr('checked');
+ cj("#toggleSelect").prop('checked', false);
var formName = "{/literal}{$form.formName}{literal}";
on_load_init_checkboxes(formName);
}
<script type="text/javascript">
{literal}
cj(function($) {
- cj("#toggleSelect, input[id^=mark_x_]").removeAttr('checked');
+ cj("#toggleSelect, input[id^=mark_x_]").prop('checked', false);
var cids = [];
var i = 0;
{/literal}
cids[i++] = "#mark_x_{$selectedContactId}";
{/foreach}
{literal}
- $(cids.join(',')).attr('checked', 'checked');
+ $(cids.join(',')).prop('checked', true);
if (cids.length > 0) {
- $('input[name=radio_ts][value=ts_sel]').attr('checked', 'checked');
+ $('input[name=radio_ts][value=ts_sel]').prop('checked', true);
}
var params = {getCount: cids.length};
countSelections(params);
}
else if (name == 'resetSel' && selection == 'reset') {
params.variableType = 'multiple';
- cj("#toggleSelect, input[id^=mark_x_]").removeAttr('checked');
+ cj("#toggleSelect, input[id^=mark_x_]").prop('checked', false);
}
else {
params.name = name;
<script type="text/javascript">
function showHideSharedAddress( blockNo, showSelect ) {
// based on checkbox, show or hide
- if ( cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).attr( 'checked') ) {
+ if ( cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).prop('checked') ) {
if ( showSelect && cj( '#shared-address-display-' + blockNo ).length == 0 ) {
cj( '#shared-address-' + blockNo ).show( );
}
{literal}
<script type="text/javascript">
function verify( ) {
- if (cj('#is_email_receipt').attr( 'checked' )) {
+ if (cj('#is_email_receipt').prop('checked' )) {
var ok = confirm( '{/literal}{ts escape='js'}Click OK to save this contribution record AND send a receipt to the contributor now{/ts}{literal}.' );
if (!ok) {
return false;
});
function checkEmailDependancies( ) {
- if (cj('#is_email_receipt').attr( 'checked' )) {
+ if (cj('#is_email_receipt').prop('checked' )) {
cj('#fromEmail').show( );
cj('#receiptDate').hide( );
}
//disabled auto renew settings.
var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
if ( allowAutoRenew && cj("#auto_renew") ) {
- cj("#auto_renew").attr( 'checked', false );
+ cj("#auto_renew").prop('checked', false );
cj('#allow_auto_renew').hide( );
}
}
{/literal}
{if $relatedOrganizationFound and $reset}
- cj( "#is_for_organization" ).attr( 'checked', true );
+ cj( "#is_for_organization" ).prop('checked', true );
showOnBehalf(false);
{elseif $onBehalfRequired}
showOnBehalf(true);
cj('#allow_auto_renew').show();
} else if ( autoRenewOption == 2 ) {
var autoRenew = cj("#auto_renew");
- autoRenew.attr( 'checked', true );
+ autoRenew.prop('checked', true );
autoRenew.attr( 'readonly', true );
cj('#allow_auto_renew').show();
}
}
var autoRenew = cj("#auto_renew");
- if ( considerUserInput ) isChecked = autoRenew.attr( 'checked' );
+ if ( considerUserInput ) isChecked = autoRenew.prop('checked' );
//its a normal recur contribution.
if ( cj( "is_recur" ) &&
if ( readOnly && funName == 'show();' ) isChecked = true;
autoRenew.attr( 'readonly', readOnly );
- autoRenew.attr( 'checked', isChecked );
+ autoRenew.prop('checked', isChecked );
eval( "cj('#allow_auto_renew')." + funName );
}
//keep read only always checked.
cj( "#auto_renew" ).click(function( ) {
if ( cj(this).attr( 'readonly' ) ) {
- cj(this).attr( 'checked', true );
+ cj(this).prop('checked', true );
}
});
});
showOnBehalf({/literal}"{$onBehalfRequired}"{literal});
cj( "#mode" ).hide( );
- cj( "#mode" ).attr( 'checked', 'checked' );
- if ( cj( "#mode" ).attr( 'checked' ) && !{/literal}"{$reset}"{literal} ) {
+ cj( "#mode" ).prop('checked', true );
+ if ( cj( "#mode" ).prop('checked' ) && !{/literal}"{$reset}"{literal} ) {
$text = ' {/literal}{ts escape="js"}Use existing organization{/ts}{literal} ';
cj( "#createNewOrg" ).text( $text );
- cj( "#mode" ).removeAttr( 'checked' );
+ cj( "#mode" ).prop('checked', false );
}
function showOnBehalf(onBehalfRequired) {
- if ( cj( "#is_for_organization" ).attr( 'checked' ) || onBehalfRequired ) {
+ if ( cj( "#is_for_organization" ).prop('checked' ) || onBehalfRequired ) {
var urlPath = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4&onbehalf=1'}";
urlPath += "{$urlParams}";
{if $mode eq 'test'}
});
}
cj("#select_org tr td").find( 'input[type=radio], input[type=checkbox]' ).each(function( ) {
- cj(this).attr('checked', false);
+ cj(this).prop('checked', false);
});
}
function createNew( ) {
- if (cj("#mode").attr('checked')) {
+ if (cj("#mode").prop('checked')) {
var textMessage = ' {/literal}{ts escape="js"}Use existing organization{/ts}{literal} ';
cj("#onbehalf_organization_name").removeAttr('readonly');
- cj("#mode").removeAttr('checked');
+ cj("#mode").prop('checked', false);
resetValues( false );
}
else {
var textMessage = ' {/literal}{ts escape="js"}Enter a new organization{/ts}{literal} ';
- cj("#mode").attr('checked', 'checked');
+ cj("#mode").prop('checked', true);
setOrgName( );
}
cj("#createNewOrg").text(textMessage);
for (var ele in data) {
if (data[ele].type == 'Radio') {
if (data[ele].value) {
- cj("input[name='"+ ele +"']").filter("[value=" + data[ele].value + "]").attr('checked', 'checked');
+ cj("input[name='"+ ele +"']").filter("[value=" + data[ele].value + "]").prop('checked', true);
}
}
else if (data[ele].type == 'CheckBox') {
if (data[ele].value) {
- cj("input[name='"+ ele +"']").attr('checked','checked');
+ cj("input[name='"+ ele +"']").prop('checked','checked');
}
}
else if (data[ele].type == 'Multi-Select') {
function check_price_set(price_set_radio_buttons) {
if (!amount) {
cj(price_set_radio_buttons).each(function(){
- if (cj(this).attr('checked')) {
+ if (cj(this).prop('checked')) {
amount = cj(this).attr('data-amount');
if (typeof amount !== "undefined") {
amount = Number(amount);
cj(option[0]).trigger('change');
}
else if (cj(price_sets[amount]).attr('type') == 'checkbox') {
- cj(price_sets[amount]).attr("checked",true);
+ cj(price_sets[amount]).prop("checked",true);
if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
if (totalfee > 0) {
totalfee += amount;
cj(option[0]).trigger('change');
}
else if (cj(price_sets[selected_price_set]).attr('type') == 'checkbox') {
- cj(price_sets[selected_price_set]).attr("checked",true);
+ cj(price_sets[selected_price_set]).prop("checked",true);
if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
if (totalfee > 0) {
totalfee += amount;
function checked_payment_processors() {
var ids = [];
cj('.crm-contribution-contributionpage-amount-form-block-payment_processor input[type="checkbox"]').each(function(){
- if(cj(this).attr('checked')) {
+ if(cj(this).prop('checked')) {
var id = cj(this).attr('id').split('_')[2];
ids.push(id);
}
function payLater(chkbox) {
var elementId = 'payLaterFields';
- if (cj('#' + chkbox).attr('checked')) {
+ if (cj('#' + chkbox).prop('checked')) {
cj('#' + elementId).show();
} else {
cj('#' + elementId).hide();
} else {
cj('#amountFields').show();
}
- cj("#amount_block_is_active").attr( 'checked', true );
+ cj("#amount_block_is_active").prop('checked', true );
break;
case 'is_pledge_active' :
if ( priceSetID ) cj( "#price_set_id" ).val( '' );
cj('#amountFields').show();
}
- cj("#amount_block_is_active").attr( 'checked', true );
+ cj("#amount_block_is_active").prop('checked', true );
break;
case 'amount_block_is_active' :
if(display) {
cj( '#recurringContribution' ).show( );
} else {
- if ( cj( '#is_recur' ).attr( 'checked' ) ) {
- cj( '#is_recur' ).removeAttr("checked");
+ if ( cj( '#is_recur' ).prop('checked' ) ) {
+ cj( '#is_recur' ).prop('checked', false);
cj( '#recurFields' ).hide( );
}
cj( '#recurringContribution' ).hide( );
}
}
if(checked) {
- cj('#billingcheckbox').attr('checked', 'checked');
+ cj('#billingcheckbox').prop('checked', true);
cj('.billing_name_address-group').hide();
}
var orig_id = input_ids[id];
// if billing checkbox is active, copy other field into billing field
- if(cj('#billingcheckbox').attr('checked')) {
+ if(cj('#billingcheckbox').prop('checked')) {
cj(orig_id).val( cj(id).val() );
};
});
var orig_id = select_ids[id];
// if billing checkbox is active, copy other field into billing field
- if(cj('#billingcheckbox').attr('checked')) {
+ if(cj('#billingcheckbox').prop('checked')) {
cj(orig_id+' option').removeAttr('selected');
cj(orig_id+' option[value="'+cj(id).val()+'"]').attr('selected', 'selected');
};
if (!showMaxMultiple) {
cj("tr#multiple").hide();
}
- else if(cj( '#is_multiple').attr('checked')) {
+ else if(cj( '#is_multiple').prop('checked')) {
cj("tr#multiple").show();
}
}
{literal}
cj("document").ready(function() {
function refresh() {
- var is_pay_later = cj(pay_later_sel).attr("checked");
+ var is_pay_later = cj(pay_later_sel).prop("checked");
cj(".credit_card_info-group").toggle(!is_pay_later);
cj(".pay-later-instructions").toggle(is_pay_later);
cj("div.billingNameInfo-section .description").html(is_pay_later ? "Enter the billing address at which you can be invoiced." : "Enter the name as shown on your credit or debit card, and the billing address for this card.");
cj("#contribution_status_id").val( cStatusId );
//unset value for send receipt check box.
- cj("#send_receipt").attr( "checked", false );
+ cj("#send_receipt").prop("checked", false );
cj("#send_confirmation_receipt").hide( );
// set receive data to null.
<script type="text/javascript">
{literal}
cj("#is_multiple_registrations").change( function( ) {
- if ( !cj(this).attr( 'checked') ) {
+ if ( !cj(this).prop('checked') ) {
cj("#additional_custom_pre_id").val('');
cj("#additional_custom_post_id").val('');
cj(".crm-event-manage-registration-form-block-additional_custom_post_multiple").hide();
// Display info
cj('.ui-notify-message .ui-notify-close').click();
- if ( cj("#allow_same_participant_emails").attr( 'checked' ) && cj("#is_multiple_registrations").attr( 'checked' ) ) {
+ if ( cj("#allow_same_participant_emails").prop('checked' ) && cj("#is_multiple_registrations").prop('checked' ) ) {
CRM.alert( msg1, '', 'info', {expires:0} );
- } else if ( cj("#allow_same_participant_emails").attr( 'checked' ) && !cj("#is_multiple_registrations").attr( 'checked' ) ) {
+ } else if ( cj("#allow_same_participant_emails").prop('checked' ) && !cj("#is_multiple_registrations").prop('checked' ) ) {
CRM.alert( msg2, '', 'info', {expires:0} );
- } else if ( !cj("#allow_same_participant_emails").attr( 'checked' ) && cj("#is_multiple_registrations").attr( 'checked' ) ) {
+ } else if ( !cj("#allow_same_participant_emails").prop('checked' ) && cj("#is_multiple_registrations").prop('checked' ) ) {
CRM.alert( msg3, '', 'info', {expires:0} );
}
}
case 'checkbox':
var checkBoxValue = eleIdpart[1].split(']');
- if ( cj(obj).attr("checked") == true &&
+ if ( cj(obj).prop("checked") == true &&
fieldOptionsFull[eleId] &&
fieldOptionsFull[eleId][checkBoxValue[0]]) {
showError = true;
notificationStatusIds = notificationStatusIds.split(',');
if (cj.inArray(cj('select#status_id option:selected').val(), notificationStatusIds) > -1) {
cj("#notify").show();
- cj("#is_notify").attr('checked', true);
+ cj("#is_notify").prop('checked', true);
}
else {
cj("#notify").hide();
- cj("#is_notify").removeAttr('checked');
+ cj("#is_notify").prop('checked', false);
}
}
{literal}
<script type="text/javascript">
cj(function(){
- cj('input[name="export_format"]').filter('[value=IIF]').attr('checked', true);
+ cj('input[name="export_format"]').filter('[value=IIF]').prop('checked', true);
cj('#_qf_Export_next').click(function(){
cj(this).hide();
cj('#_qf_Export_cancel').val('{/literal}{ts}Done{/ts}{literal}');
cj(function() {
cj('#start_date_display').change( function( ) {
if ( cj(this).val( ) ) {
- cj('#now').attr( 'checked', false );
+ cj('#now').prop('checked', false );
}
});
cj('#now').change( function( ) {
- if ( cj('#now').attr('checked', true ) ) {
+ if ( cj('#now').prop('checked', true ) ) {
cj('#start_date_display').val( '' );
cj('#start_date').val( '' );
cj('#start_date_time').val( '' );
var archiveOption = cj("input[name^='is_archived']:radio");
cj('#status_unscheduled').change(function() {
if (cj(this).prop('checked') ) {
- archiveOption.attr('checked',false);
+ archiveOption.prop('checked',false);
archiveOption.attr('readonly',true);
} else {
archiveOption.attr('readonly',false);
}
}).trigger('change');
cj(".crm-search-form-block-is_archive .crm-clear-link a").click(function() {
- archiveOption.attr('checked',false);
+ archiveOption.prop('checked',false);
cj('#status_unscheduled').attr('readonly',false);
});
});
function disableDraft() {
- cj('#status_unscheduled').attr('checked',false);
+ cj('#status_unscheduled').prop('checked',false);
cj('#status_unscheduled').attr('readonly',true);
}
</script>
cj(this).parent().parent().hide();
}
});
- if (!cj('#override_verp').attr('checked')){
+ if (!cj('#override_verp').prop('checked')){
cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').hide();
}
cj('#override_verp').click(function(){
cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').toggle();
- if (!cj('#override_verp').attr('checked')) {
- cj('#forward_replies').attr('checked',false);
- cj('#auto_responder').attr('checked',false);
+ if (!cj('#override_verp').prop('checked')) {
+ cj('#forward_replies, #auto_responder').prop('checked', false);
}
});
if ( !mode ) {
// Offline form (mode = false) has the record_contribution checkbox
cj('#record_contribution').click( function( ) {
- if ( cj(this).attr('checked') ) {
+ if ( cj(this).prop('checked') ) {
cj('#recordContribution').show( );
setPaymentBlock( false, true);
}
function setDifferentContactBlock( ) {
// show/hide different contact section
- if ( cj('#is_different_contribution_contact').attr('checked') ) {
+ if ( cj('#is_different_contribution_contact').prop('checked') ) {
cj('#record-different-contact').show();
}
else {
{/literal}{if !$membershipMode}{literal}
showHideMemberStatus();
function showHideMemberStatus() {
- if ( cj( "#is_override" ).attr('checked' ) ) {
+ if ( cj( "#is_override" ).prop('checked' ) ) {
cj('#memberStatus').show( );
cj('#memberStatus_show').hide( );
}
{/literal}{if $action eq 1}{literal}
if (!checkboxEvent) {
if (allMemberships[memType]['total_amount_numeric'] > 0) {
- cj('#record_contribution').attr('checked','checked');
+ cj('#record_contribution').prop('checked','checked');
cj('#recordContribution').show();
}
else {
- cj('#record_contribution').removeAttr('checked');
+ cj('#record_contribution').prop('checked', false);
cj('#recordContribution').hide();
}
}
if ( allowAutoRenew || alreadyAutoRenew ) {
cj( "#auto_renew" ).click(function( ) {
if ( cj(this).attr( 'readonly' ) ) {
- cj(this).attr( 'checked', true );
+ cj(this).prop('checked', true );
}
});
}
//for update lets hide it when not already recurring.
if ( action == 2 ) {
//user can't cancel auto renew by unchecking.
- if ( cj("#auto_renew").attr( 'checked' ) ) {
+ if ( cj("#auto_renew").prop('checked' ) ) {
cj("#auto_renew").attr( 'readonly', true );
}
else {
//we don't have both required values.
if ( !processorId || !membershipType ) {
- cj("#auto_renew").attr( 'checked', false );
+ cj("#auto_renew").prop('checked', false );
cj("#autoRenew").hide( );
return;
}
var currentOption = autoRenewOptions[membershipType];
if ( !currentOption || !recurProcessors[processorId] ) {
- cj("#auto_renew").attr( 'checked', false );
+ cj("#auto_renew").prop('checked', false );
cj("#autoRenew").hide( );
return;
}
if ( currentOption == 1 ) {
cj("#autoRenew").show( );
if ( cj("#auto_renew").attr( 'readonly' ) ) {
- cj("#auto_renew").attr('checked', false );
+ cj("#auto_renew").prop('checked', false );
cj("#auto_renew").removeAttr( 'readonly' );
}
}
else if ( currentOption == 2 ) {
cj("#autoRenew").show( );
- cj("#auto_renew").attr( 'checked', true );
+ cj("#auto_renew").prop('checked', true );
cj("#auto_renew").attr( 'readonly', true );
}
else {
- cj("#auto_renew").attr( 'checked', false );
+ cj("#auto_renew").prop('checked', false );
cj("#autoRenew").hide( );
}
//play w/ receipt option.
- if ( cj("#auto_renew").attr( 'checked' ) ) {
+ if ( cj("#auto_renew").prop('checked' ) ) {
cj("#notice").hide( );
- cj("#send_receipt").attr( 'checked', false );
+ cj("#send_receipt").prop('checked', false );
cj("#send-receipt").hide( );
}
else {
cj("#send-receipt").show( );
- if ( cj("#send_receipt").attr( 'checked' ) ) {
+ if ( cj("#send_receipt").prop('checked' ) ) {
cj("#notice").show( );
}
}
{literal}
function buildReceiptANDNotice( ) {
- if ( cj("#auto_renew").attr( 'checked' ) ) {
+ if ( cj("#auto_renew").prop('checked' ) ) {
cj("#notice").hide( );
cj("#send-receipt").hide( );
}
else {
cj("#send-receipt").show( );
- if ( cj("#send_receipt").attr( 'checked' ) ) {
+ if ( cj("#send_receipt").prop('checked' ) ) {
cj("#notice").show( );
}
}
cj('#autoRenew').hide();
var autoRenew = cj("#auto_renew");
autoRenew.removeAttr( 'readOnly' );
- autoRenew.removeAttr( 'checked' );
+ autoRenew.prop('checked', false );
{/literal}{/if}{literal}
return;
}
cj('#autoRenew').hide();
var autoRenew = cj("#auto_renew");
autoRenew.removeAttr( 'readOnly' );
- autoRenew.removeAttr( 'checked' );
+ autoRenew.prop('checked', false );
if ( autoRenewOption == 1 ) {
cj('#autoRenew').show();
}
else if ( autoRenewOption == 2 ) {
autoRenew.attr( 'readOnly', true );
- autoRenew.attr( 'checked', true );
+ autoRenew.prop('checked', true );
cj('#autoRenew').show();
}
{/literal}{/if}{literal}
if ( cj(this).attr('price') ) {
switch( cj(this).attr('type') ) {
case 'checkbox':
- if ( cj(this).attr('checked') ) {
+ if ( cj(this).prop('checked') ) {
eval( 'var option = ' + cj(this).attr('price') ) ;
var ele = option[0];
var memTypeId = optionsMembershipTypes[ele];
break;
case 'radio':
- if ( cj(this).attr('checked') && cj(this).val() ) {
+ if ( cj(this).prop('checked') && cj(this).val() ) {
var memTypeId = optionsMembershipTypes[cj(this).val()];
if ( memTypeId && cj.inArray(memTypeId, currentMembershipType) == -1 ) {
currentMembershipType[count] = memTypeId;
}
function enableAmountSection( setContributionType ) {
- if ( !cj('#record_contribution').attr('checked') ) {
+ if ( !cj('#record_contribution').prop('checked') ) {
cj('#record_contribution').click( );
cj('#recordContribution').show( );
}
// function to show/hide membership block fields
function showHideMembershipBlock( ) {
- if ( cj('#member_is_active').attr('checked') ) {
+ if ( cj('#member_is_active').prop('checked') ) {
cj('#memberFields').show();
} else {
cj('#memberFields').hide();
cj(function () {
cj('#record_contribution').click(function () {
- if (cj(this).attr('checked')) {
+ if (cj(this).prop('checked')) {
cj('#recordContribution').show();
setPaymentBlock(true);
}
if (!checkboxEvent) {
if (allMemberships[memType]['total_amount_numeric'] > 0) {
- cj('#record_contribution').attr('checked', 'checked');
+ cj('#record_contribution').prop('checked', true);
cj('#recordContribution').show();
}
else {
- cj('#record_contribution').removeAttr('checked');
+ cj('#record_contribution').prop('checked', false);
cj('#recordContribution').hide();
}
}
function setDifferentContactBlock() {
//get the
- if (cj('#contribution_contact').attr('checked')) {
+ if (cj('#contribution_contact').prop('checked')) {
cj('#record-different-contact').show();
}
else {
if($(this).is(":checked")) {
$('#merge_same_address').attr('disabled', true);
$('#merge_same_household').attr('disabled', true);
- $('#merge_same_address').attr('checked', false);
- $('#merge_same_household').attr('checked', false);
+ $('#merge_same_address').prop('checked', false);
+ $('#merge_same_household').prop('checked', false);
}
else {
$('#merge_same_address').attr('disabled', false);
});
-});
\ No newline at end of file
+});
optionPart = option[1].split(optionSep);
addprice = parseFloat( optionPart[0] );
- if( cj(this).attr('checked') ) {
+ if( cj(this).prop('checked') ) {
totalfee += addprice;
price[ele] += addprice;
}
//event driven calculation of element.
cj(this).click( function(){
- if ( cj(this).attr('checked') ) {
+ if ( cj(this).prop('checked') ) {
totalfee += addprice;
price[ele] += addprice;
} else {
price[ele] = 0;
}
- if( cj(this).attr('checked') ) {
+ if( cj(this).prop('checked') ) {
totalfee = parseFloat(totalfee) + addprice - parseFloat(price[ele]);
price[ele] = addprice;
}
addCount = parseInt(optionPart[1]);
}
- if( cj(this).attr('checked') ) {
+ if( cj(this).prop('checked') ) {
pPartiCount += addCount;
pPartiRef[ele] += addCount;
}
cj(this).click( function(){
- if( cj(this).attr('checked') ) {
+ if( cj(this).prop('checked') ) {
pPartiCount += addCount;
pPartiRef[ele] += addCount;
} else {
pPartiRef[ele] = 0;
}
- if( cj(this).attr('checked') ) {
+ if( cj(this).prop('checked') ) {
pPartiCount = parseInt(pPartiCount) + addCount - parseInt(pPartiRef[ele]);
pPartiRef[ele] = addCount;
}
cj('input[id^="order_by_section_"]').click(disPageBreak).each(disPageBreak);
function disPageBreak() {
- if (!cj(this).attr('checked')) {
+ if (!cj(this).prop('checked')) {
cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').attr({checked: false, disabled: "disabled"});
}
else {
// clear values on hidden field, so they're not saved
cj('select#order_by_column_'+ i).val('');
cj('select#order_by_order_'+ i).val('ASC');
- cj('input#order_by_section_'+ i).attr('checked', false);
- cj('input#order_by_pagebreak_'+ i).attr('checked', false);
+ cj('input#order_by_section_'+ i).prop('checked', false);
+ cj('input#order_by_pagebreak_'+ i).prop('checked', false);
}
{/literal}
var formName = {/literal}"{$form.formName}"{literal};
cj('#_qf_' + formName + '_submit_save').click (
function(){
- if ( cj('#is_navigation').attr('checked') && cj('#parent_id').val() == '') {
+ if ( cj('#is_navigation').prop('checked') && cj('#parent_id').val() == '') {
var confirmMsg = {/literal}'{ts escape="js"}You have chosen to include this report in the Navigation Menu without selecting a Parent Menu item from the dropdown. This will add the report to the top level menu bar. Are you sure you want to continue?{/ts}'{literal}
return confirm(confirmMsg);
}
cj(function() {
cj('#start_date_display').change( function( ) {
if ( cj(this).val( ) ) {
- cj('#now').attr( 'checked', false );
+ cj('#now').prop('checked', false );
}
});
cj('#now').change( function( ) {
- if ( cj('#now').attr('checked', true ) ) {
+ if ( cj('#now').prop('checked', true ) ) {
cj('#start_date_display').val( '' );
cj('#start_date').val( '' );
cj('#start_date_time').val( '' );
}
else if( $.inArray( "Search Profile", otherModule ) > -1 ){
$('#profile_visibility').show();
- $("#in_selector").attr('checked',true);
+ $("#in_selector").prop('checked',true);
}
else if( $.inArray( "Profile", otherModule ) == -1 && $.inArray( "Search Profile", otherModule ) == -1 ){
$('#profile_visibility').hide();
if (cj("#visibility").val() == "User and User Admin Only") {
is_search.hide();
in_selector.hide();
- cj("#is_searchable").attr('checked',false);
+ cj("#is_searchable").prop('checked',false);
}
else {
- if (!cj("#is_view").attr('checked')) {
+ if (!cj("#is_view").prop('checked')) {
is_search.show();
}
var fldName = cj("#field_name_1").val();
}
else {
if (cj('#is_multi_summary').is(':checked')) {
- cj('#is_multi_summary').removeAttr('checked');
+ cj('#is_multi_summary').prop('checked', false);
}
cj('.crm-uf-field-form-block-is_multi').hide();
}
}
else {
if (cj('#is_multi_summary').is(':checked')) {
- cj('#is_multi_summary').removeAttr('checked');
+ cj('#is_multi_summary').prop('checked', false);
}
cj('.crm-uf-field-form-block-is_multi').hide();
}
function viewOnlyShowHide() {
var is_search = cj('#is_search_label, #is_search_html');
- if (cj("#is_view").attr('checked')) {
+ if (cj("#is_view").prop('checked')) {
is_search.hide();
- cj("#is_searchable").attr('checked', false);
+ cj("#is_searchable").prop('checked', false);
}
else if (cj("#visibility").val() != "User and User Admin Only") {
is_search.show();
var execBlock = '#' + element['0'] + '-' + block + '-html Input[id*="' + element['2'] + '"]';
//element to check for checkbox
- var elementChecked = cj( '#' + object ).attr('checked');
+ var elementChecked = cj( '#' + object ).prop('checked');
if ( elementChecked ) {
cj( execBlock ).each( function() {
if ( cj(this).attr('id') != object ) {
- cj(this).attr( 'checked', false );
+ cj(this).prop('checked', false );
}
});
} else {
- cj( '#' + object ).attr( 'checked', false );
+ cj( '#' + object ).prop('checked', false );
}
//check if non of elements is set Primary / Allowed to Login.
if( cj.inArray( element['2'].slice('2'), [ 'Primary', 'Login' ] ) != -1 ) {
primary = false;
cj( execBlock ).each( function( ) {
- if ( cj(this).attr( 'checked' ) ) {
+ if ( cj(this).prop('checked' ) ) {
primary = true;
}
});
if( ! primary ) {
- cj('#' + object).attr( 'checked', true );
+ cj('#' + object).prop('checked', true );
}
}
}
return clearFirstBlock(blockName , blockId);
}
- if ( cj( "#"+ blockName + "_" + blockId + "_IsPrimary").attr('checked') ) {
+ if ( cj( "#"+ blockName + "_" + blockId + "_IsPrimary").prop('checked') ) {
var primaryBlockId = 1;
// consider next block as a primary,
// when user delete first block
}
// finally sets the primary address
- cj( '#'+ blockName + '_' + primaryBlockId + '_IsPrimary').attr('checked', true);
+ cj( '#'+ blockName + '_' + primaryBlockId + '_IsPrimary').prop('checked', true);
}
//remove the spacer for address block only.
if ( firstCheckElement.length > 1 ) {
// lets uncheck all the checkbox except first one
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').removeAttr('checked');
+ cj('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').prop('checked', false);
//here for each checkbox for first row, check if it is checked and set remaining checkboxes
firstCheckElement.each(function() {
var elementName = cj(this).attr('name');
var correctIndex = elementName.split('field['+ firstEntityId +']['+ fname +'][');
correctIndexValue = correctIndex[1].replace(']', '');
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').attr('checked',true).change();
+ cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').prop('checked',true).change();
}
});
}
else {
if ( firstCheckElement.prop('checked') ) {
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').attr('checked',true).change();
+ cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change();
}
else {
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').removeAttr('checked').change();
+ cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change();
}
}
}