I had this working in prototype.js but it conflicted with a few script files. This is how I set it up in the new script using http://digitalbush.com/projects/masked-input-plugin/
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.maskedinput.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
jQuery(function($){
$("#phone").mask("(999)999-9999");
$.mask.definitions['~']='[+-]';
$("#eyescript").mask("~9.99 ~9.99 999");
});
</script>
This is obviously missing something based on my script in prototype.js, here is an example I had to remove.
<script type="text/javascript" src="/media/system/js/prototype.js"></script>
<script type="text/javascript" src="/media/system/js/prototype.maskedinput.js"></script>
<script type="text/javascript">
Event.observe(window, 'load', function() {
new MaskedInput('#phone', '(999)999-9999');
new MaskedInput('#eyescript', '~9.99 ~9.99 999', {
completed: function(){
alert("You typed the following: " + this.getValue());
}
});
MaskedInput.definitions['~']='[+-]';
new MaskedInput('#eyescript2', '~9.99 ~9.99 999', {
completed: function(){
alert("You typed the following: " + this.getValue());
}
});
});
</script>
Like I said, this script did work but gave me conflicts with too many thing (mootools/jquery) so I want to make the jquery version work for this action instead and see if it resolves the issue.
I was able to get it working with this…