Yii Framework Forum: Formularbearbeitung - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Formularbearbeitung Fehler Rate Topic: -----

#1 User is offline   Franker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 02-January 13

Posted 23 January 2013 - 02:45 PM

Hey..

habe derzeit einen kleinen Fehler und finde einfach meinen Fehler nicht. Vielleicht kann mir ja jemand helfen.

View (index.php):
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'index-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

	<div class="row">

		<?php echo $form->textField($model,'username'); ?>
		
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Submit'); ?>
	</div>

<?php $this->endWidget(); ?>

</div>


SiteController.php:

public function actionIndex()
    {
         
        $model = new User;
        if (isset($_POST['IndexForm'])) {
            echo "muh";
        }
        
        $this->render('index', array('model' => $model));
    }


Wenn der submitbutton im View gedrückt wird, müsste er doch "muh" ausgeben?! Macht er aber nicht. Wo ist der Fehler?

Vielen Dank!
0

#2 User is offline   mbi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 604
  • Joined: 08-May 09

Posted 23 January 2013 - 05:16 PM

mach doch mal
var_dump($_POST);

0

#3 User is offline   Franker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 02-January 13

Posted 23 January 2013 - 06:12 PM

View Postmbi, on 23 January 2013 - 05:16 PM, said:

mach doch mal
var_dump($_POST);



Danke!!!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users