From 12c8482bf883988c0fc5ed4c8972396af63e8258 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Thu, 19 Apr 2012 16:18:33 +0200 Subject: Grundlegendes zu Forms --- protected/config/main.php | 3 +++ protected/views/site/contact.php | 27 ++++++++++++++------------- themes/astaf/views/skins/CActiveForm.php | 8 ++++++++ themes/astaf/views/skins/CForm.php | 8 ++++++++ 4 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 themes/astaf/views/skins/CActiveForm.php create mode 100644 themes/astaf/views/skins/CForm.php diff --git a/protected/config/main.php b/protected/config/main.php index 3430057..e75d32e 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -42,6 +42,9 @@ return array( 'cache' => array( 'class' => 'system.caching.CFileCache', ), + 'widgetFactory' => array( + 'enableSkin' => true, + ), // uncomment the following to enable URLs in path-format /* 'urlManager'=>array( diff --git a/protected/views/site/contact.php b/protected/views/site/contact.php index 51f90a9..a64fe4a 100644 --- a/protected/views/site/contact.php +++ b/protected/views/site/contact.php @@ -19,46 +19,47 @@ $this->breadcrumbs=array( If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.

-
- -beginWidget('CActiveForm', array( +
+beginWidget('CActiveForm', array( 'id'=>'contact-form', 'enableClientValidation'=>true, 'clientOptions'=>array( - 'validateOnSubmit'=>true, + 'validateOnSubmit'=>true, ), )); ?> - -

Fields with * are required.

+

Fields with * are required.

errorSummary($model); ?> -
+
labelEx($model,'name'); ?> textField($model,'name'); ?> error($model,'name'); ?>
-
+
labelEx($model,'email'); ?> textField($model,'email'); ?> error($model,'email'); ?>
-
+
labelEx($model,'subject'); ?> textField($model,'subject',array('size'=>60,'maxlength'=>128)); ?> error($model,'subject'); ?>
-
+
labelEx($model,'body'); ?> textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?> error($model,'body'); ?>
-
+
labelEx($model,'verifyCode'); ?>
widget('CCaptcha'); ?> @@ -70,8 +71,8 @@ If you have business inquiries or other questions, please fill out the following
-
- +
+ 'ym-button ym-add')); ?>
endWidget(); ?> diff --git a/themes/astaf/views/skins/CActiveForm.php b/themes/astaf/views/skins/CActiveForm.php new file mode 100644 index 0000000..63baf22 --- /dev/null +++ b/themes/astaf/views/skins/CActiveForm.php @@ -0,0 +1,8 @@ + array( + 'htmlOptions'=>array( 'class'=>'ym-form'), + ), + + +); \ No newline at end of file diff --git a/themes/astaf/views/skins/CForm.php b/themes/astaf/views/skins/CForm.php new file mode 100644 index 0000000..63baf22 --- /dev/null +++ b/themes/astaf/views/skins/CForm.php @@ -0,0 +1,8 @@ + array( + 'htmlOptions'=>array( 'class'=>'ym-form'), + ), + + +); \ No newline at end of file -- cgit v1.0-28-g1787