Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Problem With Rule Not Generating Message

$
0
0
I have an field that needs to be a maximum value of 32767 - I have tried to configure the rules for the attribute however I cannot generate an error message. If I enter a value greater than 32767 the value is not saved to the database however no error is generated. The rule I am using is
public function rules()
	{
		return array(
.....
			array('provider_id, client_id', 'length', 'max'=>5),
			array('provider_id, client_id', 'numerical', 'integerOnly'=>true,  'max'=>32767, 'tooBig'=>'{attribute} must be less than 32767.', 'min'=>1, 'tooSmall'=>'{attribute} must be more than 1.'),
			array('task_id', 'length', 'max'=>11),
			array('trading_name, trade_title, address, email', 'length', 'max'=>200),
			array('telephone, mobile, fax, abn, gst', 'length', 'max'=>50),
			array('last_active', 'safe'),
........
	}

The error I want to generate is on provider_id or client_id being greater than 32767. Any help is appreciated.

Viewing all articles
Browse latest Browse all 18717


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>