Skip to content

Commit

Permalink
(Fixes issue 1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiang.xue committed Nov 1, 2010
1 parent 5e960d8 commit 79632bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -33,6 +33,7 @@ Version 1.1.5 to be released
- Enh #1618: Fixed CHttpRequest::getAcceptTypes() to make sure it works even if HTTP_ACCEPT is not defined (Y!!)
- Enh #1627: Added check if FreeType support is installed and enabled in GD (mdomba)
- Enh #1641: Added PhpUnit 3.5.0RC1 and up support (Sam Dark)
- Enh #1651: Added 'name' and 'model' properties to the attribute objects used in CActiveForm javascript code (Qiang)
- Enh #1661: Added CActiveForm 'reset' event handler to reset validation errors if using CHtml::resetButton() (mdomba)
- Enh #1667: Added CDbCriteria::index to support indexing the AR query result array with the specified attribute values (Qiang)
- Enh #1668: Added validation to ensure PHP keywords be not used as class names (Qiang)
Expand Down
2 changes: 2 additions & 0 deletions framework/web/js/source/jquery.yiiactiveform.js
Expand Up @@ -312,6 +312,8 @@
/**
* list of attributes to be validated. Each array element is of the following structure:
* {
* model : 'ModelClass', // the model class name
* name : 'name', // attribute name
* inputID : 'input-tag-id',
* errorID : 'error-tag-id',
* value : undefined,
Expand Down
7 changes: 6 additions & 1 deletion framework/web/widgets/CActiveForm.php
Expand Up @@ -354,7 +354,12 @@ public function error($model,$attribute,$htmlOptions=array(),$enableAjaxValidati
if(!isset($htmlOptions['id']))
$htmlOptions['id']=$inputID.'_em_';

$option=array('inputID'=>$inputID, 'errorID'=>$htmlOptions['id']);
$option=array(
'inputID'=>$inputID,
'errorID'=>$htmlOptions['id'],
'model'=>get_class($model),
'name'=>$attribute,
);

$optionNames=array(
'validationDelay',
Expand Down

0 comments on commit 79632bf

Please sign in to comment.