X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=templates%2FCRM%2FContribute%2FForm%2FPCP.js.tpl;h=64f4c6c170a3a378a9040042297f1f732a86321c;hb=da82de8fc3b033f0c5076f790d0755592d4ba46d;hp=5d81d64dffb2ab551eac5cc25c917a804817fa4d;hpb=2bcf3e5b72a945c90d882750227fa62670b980d6;p=civicrm-core.git diff --git a/templates/CRM/Contribute/Form/PCP.js.tpl b/templates/CRM/Contribute/Form/PCP.js.tpl index 5d81d64dff..64f4c6c170 100644 --- a/templates/CRM/Contribute/Form/PCP.js.tpl +++ b/templates/CRM/Contribute/Form/PCP.js.tpl @@ -2,7 +2,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | + | Copyright CiviCRM LLC (c) 2004-2016 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -47,7 +47,11 @@ }) // This is just a cheap trick to store the name when the form reloads .on('change', function() { - $('[name=pcp_made_through]', $form).val($(this).select2('data').text || ''); + var fieldNameVal = $(this).select2('data'); + if (!fieldNameVal) { + fieldNameVal = ''; + } + $('[name=pcp_made_through]', $form).val(fieldNameVal.text); }); });