Yii Framework Forum: Yiistrap Forum Submission - Yii Framework Forum

Jump to content

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

Yiistrap Forum Submission

#1 User is offline   eanderson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 16-July 14

Posted 17 July 2014 - 08:16 AM

Hello,

I am having trouble getting Yiistrap to work with form submissions. I am currently able to successfully save a form using standard Yii syntax like this:

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

	<div class="row">
		<?php echo $form->labelEx($model,'Deal_Name'); ?>
		<?php echo $form->textField($model,'Deal_Name'); ?>
		<?php echo $form->error($model,'Deal_Name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Owner'); ?>
		<?php echo $form->passwordField($model,'Owner'); ?>
		<?php echo $form->error($model,'Owner'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Division'); ?>
		<?php echo $form->passwordField($model,'Division'); ?>
		<?php echo $form->error($model,'Division'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>
	<?php $this->endWidget(); ?>
</div>


However when I want to do a yiistrap form I cannot get it to save properly, most likely I am missing the proper parameters to send the form correctly. Below is my Yiistrap code:

<?php echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_HORIZONTAL)
); ?>
    <?php echo TbHtml::textFieldControlGroup('Land_Deal', '',
        array('label' => 'Land Deal', 'placeholder' => 'Land Deal'
    )); ?>
    <?php echo TbHtml::textFieldControlGroup('Owner', '',
        array('label' => 'Responible Party', 'placeholder' => 'Responsible Party'
    )); ?>
    <?php echo TbHtml::textFieldControlGroup('Division', '',
        array('label' => 'Division', 'placeholder' => 'Division'
    )); ?>
    <?php echo TbHTML::submitButton('Save'
    ); ?>
<?php echo TbHtml::endForm(); ?>


Could you guys give me some insight as to what I am missing? I am still a little new to yiistrap.

thanks in advance!
0

#2 User is offline   rei 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 335
  • Joined: 10-November 10

Posted 18 July 2014 - 07:19 AM

I would suggest you to use TbActiveForm to replace CActiveForm.
Fipick - Find and pick recommendations
0

#3 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,526
  • Joined: 12-October 09
  • Location:Croatia

Posted 18 July 2014 - 07:56 AM

NOTE: moved to proper forum section
Find more about me.... btw. Do you know your WAN IP?
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