I have checked several other threads on here related to masked input plugins not working and was unable to find any answers:
Masked Input Plugin not working
jQuery Masked Input plugin not working on form input?
JQuery Masked Input plugin doesn't work
I should preface this by saying that my programming knowledge is rather limited. I have help, but that help isn't always available.
I am attempting to use this plugin
My Version #: SuiteCRM Version 7.2.1, Sugar Version 6.5.20 (Build 1001)
So I added the jQuery javascript library file and the jQuery plugin from digitalbrushes website and put them both in /admin/custom/include/javascript/
Then under the module I am currently working on which in this case is the Contracts module, the file I am working on is here: /admin/custom/modules/AOS_Contracts/views/view.edit.php
Below is the file:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.edit.php');
class AOS_ContractsViewEdit extends ViewEdit {
// function displaySubPanels() {
// return '';
// }
function display(){
$js = <<<JS
<script src="/admin/custom/include/javascript/jquery.min.js" type="text/javascript">
<script src="/admin/custom/include/javascript/jquery.maskedinput.min.js" type="text/javascript">
var \$j = jQuery.noConflict();
\$j("#home_phone_c").mask("(999) 999-9999");
\$j("#work_phone_c").mask("(999) 999-9999");
\$j("#mobile_phone_c").mask("(999) 999-9999");
\$j("#inital_deposit_amount_c").mask("999,999,999,999,999.99");
});
</script>
JS;
parent::display();
echo $js;
}
}
When I load the page and click in the fields, there is no masks present, in my chrome console I am only getting an unrelated error in my style.js file that says:
"Uncaught TypeError: $.cookie is not a function"
I have already tried wrapping this in {literal} tags as suggested by this answer: Adding custom jQuery validation in SugarCRM editview, nothing changed. I'm not really certain how or if the .ready(function() is applied to this if it is necessary. I didn't think it was because of parent::display();
.
I have tried this same page in Chrome, Firefox, Safari, and IE.... nothing. I also cleared my cache and cookies after I made the changes to ensure I was getting fresh results. I have also done a quick repair and rebuild on SuiteCRM everytime (although that should be completely unnecessary) just to cover my bases.