moneymask Just another money mask for your money-related fields

  1. Requirements
  2. Usage
  3. Resources

This is wrapper for jQuery plugin jquery-maskmoney.

Requirements

Tested very quickly on Firefox 4 and Google Chrome on Windows 7

Usage

Extract the zip file to your extensions folder.

These are the variables you can change:

element: (required) the input field to be moneymasked (uses jQuery selector)

currency: (optional) used to set the symbol if config['symbol'] is not given

config: (optional) options for this extension.

The options that you can set are

symbol the symbol to be used before of the user values. default: 'US$'

showSymbol - set if the symbol must be displayed or not. default: false

symbolStay - set if the symbol will stay in the field after the user exists the field. default: false

thousands - the thousands separator. default: ','

decimal - the decimal separator. default: '.'

precision - how many decimal places are allowed. default: 2

defaultZero - when the user enters the field, it sets a default mask using zero. default: true

allowZero - use this setting to prevent users from inputing zero. default: false

allowNegative - use this setting to prevent users from inputing negative values. default: false

Use it like this:

<?php
$this->widget('application.extensions.moneymask.MMask',array(
    'element'=>'#testing',
    'currency'=>'PHP',
    'config'=>array(
        'showSymbol'=>true,
        'symbolStay'=>true,
    )
));

echo CHtml::textField('testing', '', array('id'=>'testing'));
?>

Resources

4 0
14 followers
1 297 downloads
Yii Version: 1.1
License: MIT
Category: User Interface
Tags: mask
Developed by: morcen
Created on: Jun 5, 2011
Last updated: 7 years ago

Downloads

show all

Related Extensions