diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 6d9fef410ad38853d81e3e4b0a850cba131bcdaf..d231144f384ec0389c625f974dd422cc4800c9cb 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -858,6 +858,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } if ($self->_values['event']['is_monetary']) { + if (($fields['amount'] > 0) && !isset($fields['payment_processor'])) { + $errors['payment_processor'] = ts('Please select a Payment Method'); + } if (is_array($self->_paymentProcessor)) { $payment = CRM_Core_Payment::singleton($self->_mode, $self->_paymentProcessor, $this); $error = $payment->checkConfig($self->_mode); @@ -877,7 +880,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } } - $isZeroAmount = $skipPayementValidation = FALSE; + $isZeroAmount = $skipPaymentValidation = FALSE; if (CRM_Utils_Array::value('priceSetId', $fields)) { if (CRM_Utils_Array::value('amount', $fields) == 0) { $isZeroAmount = TRUE; @@ -899,13 +902,13 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } if ($isZeroAmount && !($self->_forcePayement && CRM_Utils_Array::value('additional_participants', $fields))) { - $skipPayementValidation = TRUE; + $skipPaymentValidation = TRUE; } // also return if paylater mode or zero fees for valid members if (CRM_Utils_Array::value('is_pay_later', $fields) || CRM_Utils_Array::value('bypass_payment', $fields) || - $skipPayementValidation || + $skipPaymentValidation || (!$self->_allowConfirmation && ($self->_requireApproval || $self->_allowWaitlist)) ) { return empty($errors) ? TRUE : $errors; diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index 7a99f40413d32c8e7ff2f3d7ebc39cf2db7f8a37..cbe7aa564647c8bf3513b28847374de9cc173fe6 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -26,320 +26,357 @@ {* Callback snippet: Load payment processor *} {if $snippet} {include file="CRM/Core/BillingBlock.tpl" context="front-end"} - -<div id="paypalExpress"> -{* Put PayPal Express button after customPost block since it's the submit button in this case. *} -{if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'} - {assign var=expressButtonName value='_qf_Register_upload_express'} - <fieldset class="crm-group payPalExpress-group"><legend>{ts}Checkout with PayPal{/ts}</legend> - <div class="description">{ts}Click the PayPal button to continue.{/ts}</div> - <div>{$form.$expressButtonName.html} <span style="font-size:11px; font-family: Arial, Verdana;">Checkout securely. Pay without sharing your financial information. </span> - </div> - </fieldset> -{/if} -</div> + <div id="paypalExpress"> + {* Put PayPal Express button after customPost block since it's the submit button in this case. *} + {if $paymentProcessor.payment_processor_type EQ 'PayPal_Express'} + {assign var=expressButtonName value='_qf_Register_upload_express'} + <fieldset class="crm-group payPalExpress-group"> + <legend>{ts}Checkout with PayPal{/ts}</legend> + <div class="description">{ts}Click the PayPal button to continue.{/ts}</div> + <div>{$form.$expressButtonName.html} <span style="font-size:11px; font-family: Arial, Verdana;">Checkout securely. Pay without sharing your financial information. </span> + </div> + </fieldset> + {/if} + </div> {else} -{if $action & 1024} + {if $action & 1024} {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"} -{/if} + {/if} -{include file="CRM/common/TrackingFields.tpl"} -{capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture} -<div class="crm-event-id-{$event.id} crm-block crm-event-register-form-block"> + {include file="CRM/common/TrackingFields.tpl"} + {capture assign='reqMark'}<span class="marker" title="{ts}This field is required.{/ts}">*</span>{/capture} + <div class="crm-event-id-{$event.id} crm-block crm-event-register-form-block"> -{* moved to tpl since need to show only for primary participant page *} -{if $requireApprovalMsg || $waitlistMsg} - <div id="id-waitlist-approval-msg" class="messages status no-popup"> - {if $requireApprovalMsg} - <div id="id-req-approval-msg">{$requireApprovalMsg}</div> - {/if} + {* moved to tpl since need to show only for primary participant page *} + {if $requireApprovalMsg || $waitlistMsg} + <div id="id-waitlist-approval-msg" class="messages status no-popup"> + {if $requireApprovalMsg} + <div id="id-req-approval-msg">{$requireApprovalMsg}</div> + {/if} {if $waitlistMsg} - <div id="id-waitlist-msg">{$waitlistMsg}</div> - {/if} - </div> -{/if} + <div id="id-waitlist-msg">{$waitlistMsg}</div> + {/if} + </div> + {/if} -{if $contact_id} -<div class="messages status no-popup" id="crm-event-register-different"> - {ts 1=$display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}" title="{ts}Click here to register a different person for this event.{/ts}">{ts 1=$display_name}Not %1, or want to register a different person{/ts}</a>?)</div> -{/if} -{if $event.intro_text} - <div id="intro_text" class="crm-section intro_text-section"> + {if $contact_id} + <div class="messages status no-popup" id="crm-event-register-different"> + {ts 1=$display_name}Welcome %1{/ts}. (<a + href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}" + title="{ts}Click here to register a different person for this event.{/ts}">{ts 1=$display_name}Not %1, or want to register a different person{/ts}</a>?) + </div> + {/if} + {if $event.intro_text} + <div id="intro_text" class="crm-section intro_text-section"> <p>{$event.intro_text}</p> - </div> -{/if} -{include file="CRM/common/cidzero.tpl"} -{if $pcpSupporterText} - <div class="crm-section pcpSupporterText-section"> + </div> + {/if} + {include file="CRM/common/cidzero.tpl"} + {if $pcpSupporterText} + <div class="crm-section pcpSupporterText-section"> <div class="content">{$pcpSupporterText}</div> - </div> -{/if} + </div> + {/if} -{if $form.additional_participants.html} - <div class="crm-section additional_participants-section" id="noOfparticipants"> + {if $form.additional_participants.html} + <div class="crm-section additional_participants-section" id="noOfparticipants"> <div class="label">{$form.additional_participants.label}</div> <div class="content"> - {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} ({ts}including yourself{/ts}){/if}<br /> - <span class="description">{ts}Fill in your registration information on this page. If you are registering additional people, you will be able to enter their registration information after you complete this page and click "Continue".{/ts}</span> + {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} ({ts}including yourself{/ts}){/if} + <br/> + <span + class="description">{ts}Fill in your registration information on this page. If you are registering additional people, you will be able to enter their registration information after you complete this page and click "Continue".{/ts}</span> </div> <div class="clear"></div> - </div> -{/if} + </div> + {/if} -{if $priceSet} - {if ! $quickConfig}<fieldset id="priceset" class="crm-group priceset-group"><legend>{$event.fee_label}</legend>{/if} - {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"} - {include file="CRM/Price/Form/ParticipantCount.tpl"} - {if ! $quickConfig}</fieldset>{/if} + {if $priceSet} + {if ! $quickConfig}<fieldset id="priceset" class="crm-group priceset-group"> + <legend>{$event.fee_label}</legend>{/if} + {include file="CRM/Price/Form/PriceSet.tpl" extends="Event"} + {include file="CRM/Price/Form/ParticipantCount.tpl"} + {if ! $quickConfig}</fieldset>{/if} - {if $form.is_pay_later} + {if $form.is_pay_later} <div class="crm-section pay_later-section"> <div class="label"> </div> - <div class="content">{$form.is_pay_later.html} {$form.is_pay_later.label}</div> - <div class="clear"></div> + <div class="content">{$form.is_pay_later.html} {$form.is_pay_later.label}</div> + <div class="clear"></div> </div> + {/if} {/if} -{/if} -{if $pcp && $is_honor_roll } - <fieldset class="crm-group pcp-group"> + {if $pcp && $is_honor_roll } + <fieldset class="crm-group pcp-group"> <div class="crm-section pcp-section"> - <div class="crm-section display_in_roll-section"> - <div class="content"> - {$form.pcp_display_in_roll.html} - {$form.pcp_display_in_roll.label} - </div> - <div class="clear"></div> + <div class="crm-section display_in_roll-section"> + <div class="content"> + {$form.pcp_display_in_roll.html} + {$form.pcp_display_in_roll.label} </div> - <div id="nameID" class="crm-section is_anonymous-section"> - <div class="content"> - {$form.pcp_is_anonymous.html} - </div> - <div class="clear"></div> + <div class="clear"></div> + </div> + <div id="nameID" class="crm-section is_anonymous-section"> + <div class="content"> + {$form.pcp_is_anonymous.html} </div> - <div id="nickID" class="crm-section pcp_roll_nickname-section"> - <div class="label">{$form.pcp_roll_nickname.label}</div> - <div class="content">{$form.pcp_roll_nickname.html} - <div class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</div> - </div> - <div class="clear"></div> + <div class="clear"></div> + </div> + <div id="nickID" class="crm-section pcp_roll_nickname-section"> + <div class="label">{$form.pcp_roll_nickname.label}</div> + <div class="content">{$form.pcp_roll_nickname.html} + <div + class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</div> </div> - <div id="personalNoteID" class="crm-section pcp_personal_note-section"> - <div class="label">{$form.pcp_personal_note.label}</div> - <div class="content"> - {$form.pcp_personal_note.html} - <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div> - </div> - <div class="clear"></div> + <div class="clear"></div> + </div> + <div id="personalNoteID" class="crm-section pcp_personal_note-section"> + <div class="label">{$form.pcp_personal_note.label}</div> + <div class="content"> + {$form.pcp_personal_note.html} + <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div> </div> + <div class="clear"></div> + </div> </div> - </fieldset> -{/if} + </fieldset> + {/if} -{* User account registration option. Displays if enabled for one of the profiles on this page. *} -{include file="CRM/common/CMSUser.tpl"} + {* User account registration option. Displays if enabled for one of the profiles on this page. *} + {include file="CRM/common/CMSUser.tpl"} -{include file="CRM/UF/Form/Block.tpl" fields=$customPre} + {include file="CRM/UF/Form/Block.tpl" fields=$customPre} -{if $form.payment_processor.label} -<fieldset class="crm-group payment_options-group" style="display:none;"> - <legend>{ts}Payment Options{/ts}</legend> - <div class="crm-section payment_processor-section"> - <div class="label">{$form.payment_processor.label}</div> - <div class="content">{$form.payment_processor.html}</div> - <div class="clear"></div> - </div> -</fieldset> -{/if} + {if $form.payment_processor.label} + <fieldset class="crm-group payment_options-group" style="display:none;"> + <legend>{ts}Payment Options{/ts}</legend> + <div class="crm-section payment_processor-section"> + <div class="label">{$form.payment_processor.label}</div> + <div class="content">{$form.payment_processor.html}</div> + <div class="clear"></div> + </div> + </fieldset> + {/if} -<div id="billing-payment-block"> - {* If we have a payment processor, load it - otherwise it happens via ajax *} - {if $ppType} - {include file="CRM/Event/Form/Registration/Register.tpl" snippet=4} - {/if} -</div> -{include file="CRM/common/paymentBlock.tpl"} + <div id="billing-payment-block"> + {* If we have a payment processor, load it - otherwise it happens via ajax *} + {if $ppType} + {include file="CRM/Event/Form/Registration/Register.tpl" snippet=4} + {/if} + </div> + {include file="CRM/common/paymentBlock.tpl"} -{include file="CRM/UF/Form/Block.tpl" fields=$customPost} + {include file="CRM/UF/Form/Block.tpl" fields=$customPost} -{if $isCaptcha} - {include file='CRM/common/ReCAPTCHA.tpl'} -{/if} + {if $isCaptcha} + {include file='CRM/common/ReCAPTCHA.tpl'} + {/if} -<div id="crm-submit-buttons" class="crm-submit-buttons"> - {include file="CRM/common/formButtons.tpl" location="bottom"} -</div> + <div id="crm-submit-buttons" class="crm-submit-buttons"> + {include file="CRM/common/formButtons.tpl" location="bottom"} + </div> -{if $event.footer_text} - <div id="footer_text" class="crm-section event_footer_text-section"> + {if $event.footer_text} + <div id="footer_text" class="crm-section event_footer_text-section"> <p>{$event.footer_text}</p> - </div> -{/if} -</div> + </div> + {/if} + </div> + <script type="text/javascript"> + {literal} + function toggleConfirmButton() { + var payPalExpressId = "{/literal}{$payPalExpressId}{literal}"; + var elementObj = cj('input[name="payment_processor"]'); + if (elementObj.attr('type') == 'hidden') { + var processorTypeId = elementObj.val(); + } + else { + var processorTypeId = elementObj.filter(':checked').val(); + } -<script type="text/javascript"> -{literal} -function toggleConfirmButton() { - var payPalExpressId = "{/literal}{$payPalExpressId}{literal}"; - var elementObj = cj('input[name="payment_processor"]'); - if ( elementObj.attr('type') == 'hidden' ) { - var processorTypeId = elementObj.val( ); - } else { - var processorTypeId = elementObj.filter(':checked').val(); - } - - if (payPalExpressId !=0 && payPalExpressId == processorTypeId) { - cj("#crm-submit-buttons").hide(); - } else { - cj("#crm-submit-buttons").show(); - } -} + if (payPalExpressId != 0 && payPalExpressId == processorTypeId) { + cj("#crm-submit-buttons").hide(); + } + else { + cj("#crm-submit-buttons").show(); + } + } -cj('input[name="payment_processor"]').change( function() { - toggleConfirmButton(); -}); + cj('input[name="payment_processor"]').change(function () { + toggleConfirmButton(); + }); -cj(function() { - toggleConfirmButton(); -}); -{/literal} -</script> -{/if} -{literal} -<script type="text/javascript"> - {/literal}{if $pcp && $is_honor_roll }pcpAnonymous();{/if}{literal} + cj(function () { + toggleConfirmButton(); + skipPaymentMethod(); + }); - function allowParticipant( ) { - {/literal}{if $allowGroupOnWaitlist}{literal} - var additionalParticipants = cj('#additional_participants').val(); - var pricesetParticipantCount = 0; - {/literal}{if $priceSet}{literal} - pricesetParticipantCount = pPartiCount; - {/literal}{/if}{literal} + function skipPaymentMethod() { + var symbol = '{/literal}{$currencySymbol}{literal}'; + var isMultiple = '{/literal}{$event.is_multiple_registrations}{literal}'; - allowGroupOnWaitlist( additionalParticipants, pricesetParticipantCount ); - {/literal}{/if}{literal} + var flag = 1; + if (isMultiple && cj("#additional_participants").val()) { + flag = 0; + } + + cj('#priceset input').change(function () { + if (((cj(this).attr('data-amount') == '0') || (cj('#pricevalue').text() == symbol + " 0.00" )) && flag ) { + cj(".payment_options-group").hide(); + cj("div.payment_processor-section").hide(); + cj("div#payment_information").hide(); + } + else { + cj(".payment_options-group").show(); + cj("div.payment_processor-section").show(); + cj("div#payment_information").show(); + } + + }); } + {/literal} + </script> +{/if} +{literal} +<script type="text/javascript"> + {/literal}{if $pcp && $is_honor_roll }pcpAnonymous(); + {/if}{literal} - {/literal}{if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'} - {literal} - showHidePayPalExpressOption( ); + function allowParticipant() { + {/literal}{if $allowGroupOnWaitlist}{literal} + var additionalParticipants = cj('#additional_participants').val(); + var pricesetParticipantCount = 0; + {/literal}{if $priceSet}{literal} + pricesetParticipantCount = pPartiCount; {/literal}{/if}{literal} - function showHidePayPalExpressOption( ) - { - var payLaterElement = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal}; - if ( ( cj("#bypass_payment").val( ) == 1 ) || - ( payLaterElement && document.getElementsByName('is_pay_later')[0].checked ) ) { - cj("#crm-submit-buttons").show(); - cj("#paypalExpress").hide(); - } else { - cj("#paypalExpress").show(); - cj("#crm-submit-buttons").hide(); + allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount); + {/literal}{/if}{literal} } + + {/literal}{if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'} + {literal} + showHidePayPalExpressOption(); + {/literal}{/if}{literal} + + function showHidePayPalExpressOption() { + var payLaterElement = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal}; + if (( cj("#bypass_payment").val() == 1 ) || + ( payLaterElement && document.getElementsByName('is_pay_later')[0].checked )) { + cj("#crm-submit-buttons").show(); + cj("#paypalExpress").hide(); + } + else { + cj("#paypalExpress").show(); + cj("#crm-submit-buttons").hide(); } + } - {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal} - showHidePaymentInfo( ); - {/literal} {/if}{literal} + {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal} + showHidePaymentInfo(); + {/literal} {/if}{literal} - function showHidePaymentInfo( ) - { - var payLater = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal}; + function showHidePaymentInfo() { + var payLater = {/literal}{if $form.is_pay_later}true{else}false{/if}{literal}; - if ( ( cj("#bypass_payment").val( ) == 1 ) || - ( payLater && document.getElementsByName('is_pay_later')[0].checked ) ) { - cj('#billing-payment-block').hide(); - } else { + if (( cj("#bypass_payment").val() == 1 ) || + ( payLater && document.getElementsByName('is_pay_later')[0].checked )) { + cj('#billing-payment-block').hide(); + } + else { cj('#billing-payment-block').show(); - } } + } - {/literal}{if $allowGroupOnWaitlist}{literal} - allowGroupOnWaitlist( 0, 0 ); + {/literal}{if $allowGroupOnWaitlist}{literal} + allowGroupOnWaitlist(0, 0); + {/literal}{/if}{literal} + + function allowGroupOnWaitlist(additionalParticipants, pricesetParticipantCount) { + {/literal}{if $isAdditionalParticipants}{literal} + if (!additionalParticipants) { + additionalParticipants = cj('#additional_participants').val(); + } + {/literal}{else}{literal} + additionalParticipants = 0; {/literal}{/if}{literal} - function allowGroupOnWaitlist( additionalParticipants, pricesetParticipantCount ) - { - {/literal}{if $isAdditionalParticipants}{literal} - if ( !additionalParticipants ) { - additionalParticipants = cj('#additional_participants').val(); - } - {/literal}{else}{literal} - additionalParticipants = 0; - {/literal}{/if}{literal} + additionalParticipants = parseInt(additionalParticipants); + if (!additionalParticipants) { + additionalParticipants = 0; + } - additionalParticipants = parseInt( additionalParticipants ); - if ( ! additionalParticipants ) { - additionalParticipants = 0; - } + var availableRegistrations = {/literal}'{$availableRegistrations}'{literal}; + var totalParticipants = parseInt(additionalParticipants) + 1; - var availableRegistrations = {/literal}'{$availableRegistrations}'{literal}; - var totalParticipants = parseInt( additionalParticipants ) + 1; + if (pricesetParticipantCount) { + // add priceset count if any + totalParticipants += parseInt(pricesetParticipantCount) - 1; + } + var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal}; - if ( pricesetParticipantCount ) { - // add priceset count if any - totalParticipants += parseInt(pricesetParticipantCount) - 1; - } - var isrequireApproval = {/literal}'{$requireApprovalMsg}'{literal}; - - if ( totalParticipants > availableRegistrations ) { - cj( "#id-waitlist-msg" ).show( ); - cj( "#id-waitlist-approval-msg" ).show( ); - - //set the value for hidden bypass payment. - cj( "#bypass_payment").val( 1 ); - - //hide pay later. - {/literal}{if $form.is_pay_later}{literal} - cj("#is-pay-later").hide( ); - {/literal} {/if}{literal} - - } else { - if ( isrequireApproval ) { - cj( "#id-waitlist-approval-msg" ).show( ); - cj( "#id-waitlist-msg" ).hide( ); - } else { - cj( "#id-waitlist-approval-msg" ).hide( ); - } - //reset value since user don't want or not eligible for waitlist - cj( "#bypass_payment").val( 0 ); - - //need to show paylater if exists. - {/literal}{if $form.is_pay_later}{literal} - cj("#is-pay-later").show( ); - {/literal} {/if}{literal} - } + if (totalParticipants > availableRegistrations) { + cj("#id-waitlist-msg").show(); + cj("#id-waitlist-approval-msg").show(); + + //set the value for hidden bypass payment. + cj("#bypass_payment").val(1); - //now call showhide payment info. - {/literal} - {if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}{literal} - showHidePayPalExpressOption( ); - {/literal}{/if} - {literal} + //hide pay later. + {/literal}{if $form.is_pay_later}{literal} + cj("#is-pay-later").hide(); + {/literal} {/if}{literal} - {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal} - showHidePaymentInfo( ); - {/literal}{/if}{literal} } + else { + if (isrequireApproval) { + cj("#id-waitlist-approval-msg").show(); + cj("#id-waitlist-msg").hide(); + } + else { + cj("#id-waitlist-approval-msg").hide(); + } + //reset value since user don't want or not eligible for waitlist + cj("#bypass_payment").val(0); - {/literal}{if $pcp && $is_honor_roll }{literal} - function pcpAnonymous( ) { - // clear nickname field if anonymous is true - if ( document.getElementsByName("pcp_is_anonymous")[1].checked ) { - document.getElementById('pcp_roll_nickname').value = ''; - } - if ( ! document.getElementsByName("pcp_display_in_roll")[0].checked ) { - cj('#nickID, #nameID, #personalNoteID').hide(); - } else { - if ( document.getElementsByName("pcp_is_anonymous")[0].checked ) { - cj('#nameID, #nickID, #personalNoteID').show(); - } else { - cj('#nameID').show(); - cj('#nickID, #personalNoteID').hide(); - } - } + //need to show paylater if exists. + {/literal}{if $form.is_pay_later}{literal} + cj("#is-pay-later").show(); + {/literal} {/if}{literal} } + + //now call showhide payment info. + {/literal} + {if ($form.is_pay_later or $bypassPayment) and $paymentProcessor.payment_processor_type EQ 'PayPal_Express'}{literal} + showHidePayPalExpressOption(); + {/literal}{/if} + {literal} + + {/literal}{if ($form.is_pay_later or $bypassPayment) and $showHidePaymentInformation}{literal} + showHidePaymentInfo(); {/literal}{/if}{literal} + } + + {/literal}{if $pcp && $is_honor_roll }{literal} + function pcpAnonymous() { + // clear nickname field if anonymous is true + if (document.getElementsByName("pcp_is_anonymous")[1].checked) { + document.getElementById('pcp_roll_nickname').value = ''; + } + if (!document.getElementsByName("pcp_display_in_roll")[0].checked) { + cj('#nickID, #nameID, #personalNoteID').hide(); + } + else { + if (document.getElementsByName("pcp_is_anonymous")[0].checked) { + cj('#nameID, #nickID, #personalNoteID').show(); + } + else { + cj('#nameID').show(); + cj('#nickID, #personalNoteID').hide(); + } + } + } + {/literal}{/if}{literal} </script> {/literal}