I am trying to build a form in Drupal 7, one of the fields needs to have an input mask. I found the plugin masked input it seems like what I am searching for . Only there is no documentation on how to implement it (I read about currency and this plugin, yet here it is only about getting it to work).
I am new to Drupal, but searching on forums I came up with the following code:
function report_expenses_form($form, &$form_submit) {
libraries_get_path('maskedinput') . '/misc/ui/jquery.maskedinput-1.3.js';
...
$form['cash_advance']['amount'] = array(
'#title' => t('Cash Advance : '),
'#type' => 'textfield',
'#default_value' => t('$ 00,00'),
'#required' => TRUE,
'#mask' => '$?999.999.999,99',
);
....
I installed the "Libraries" and "Masked Input" plugins in Drupal and flushed my caches.
I downloaded the jquery.maskedinput-1.3.js and put it in my {DRUPAL_HOME}/misc/ui/
any Ideas?
thank you in advance
This is system Drupal path and you have no need to change it's contents.
In Drupal Libraries are external scripts that are stored in special Libraries folder. In your case in
sites/all/libraries
.So file
jquery.maskedinput-1.3.js
should be insites/all/libraries/maskedinput
folder.