Welcome to the Cookbook

loading...

4.1.4.17 money

This rule will ensure that the value is in a valid monetary amount.

Second parameter defines where symbol is located (left/right).

var $validate = array(
    'salary' => array(
        'rule' => array('money', 'left'),
        'message' => 'Please supply a valid monetary amount.'
    )
);
  1. var $validate = array(
  2. 'salary' => array(
  3. 'rule' => array('money', 'left'),
  4. 'message' => 'Please supply a valid monetary amount.'
  5. )
  6. );

View this section in 1.3 cookbook