フィールド「CompanyName」があり、検証が必要です。
これは私が持っているものです:
public function rules() {
return array(
array('CompanyName', 'compare', 'compareValue' => "google", 'operator' => '!=', 'message' => Yii::t('app', 'NOT Google'), 'on' => 'submit'),
);
}
生成された JS :
if(value=="google") {
messages.push("You wrote google!");
}
私が欲しいもの(js側のトリムを含む):
if($.trim(value)=="google") {
messages.push("You wrote google!");
}
これどうやってするの ?