Yii Framework Forum: Cactiveform Not Displaying <Form> - Yii Framework Forum

Jump to content

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

Cactiveform Not Displaying <Form> Rate Topic: -----

#1 User is offline   acainoks 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 16-November 10
  • Location:Poznań - Poland

Posted 27 September 2013 - 03:56 PM

hi
in my view I have this code
div class="form">	
<?php $form2=$this->beginWidget('CActiveForm', array(
	'id'=>'addItemDay-form',
	//'enableAjaxValidation'=>true,
	'action'=>Yii::app()->createUrl('day/addProductValue', array('id'=>$day->id_day)),
));
	
	?>
	<?php echo $form2->errorSummary($add); ?>
	<div class="row">
		<h3 id="AddToDay_nameH3"></h3>
	</div>
	<?php echo $form2->textField($add,'id', array('style'=>'display:none;','value'=>0));?>	
	<?php echo $form2->textField($add,'type', array('style'=>'display:none;','value'=>$typeAdd,));?>
	
	<?php echo $form2->textField($add,'name', array('style'=>'display:none;',));?>


	<div class="row">
		<?php echo $form2->labelEx($add,'weight'); ?>
		<?php echo $form2->textField($add,'weight'); ?>
		<?php echo $form2->error($add,'weight'); ?>
	</div>
	<div class="row">
		<?php echo $form2->labelEx($add,'time'); ?>
		<?php echo $form2->textField($add,'time', array('id'=>'timepicker_buttons')); ?>
		<?php echo $form2->error($add,'time'); ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton('Dodaj'); ?>
	</div>


<?php $this->endWidget(); ?>
</div><!-- form -->


in web :
<div class="form">
<div class="row">
<input id="AddToDay_id" type="text" name="AddToDay[id]" value="2" style="display:none;">
<input id="AddToDay_type" type="text" name="AddToDay[type]" value="product" style="display:none;">
<input id="AddToDay_name" type="text" name="AddToDay[name]" style="display:none;">
<div class="row">
<div class="row">
<label class="required" for="AddToDay_time">
<input id="timepicker_buttons" class="hasTimepicker" type="text" name="AddToDay[time]">
</div>
<div class="row buttons">
</div>


<form>
not displaying
AddToDay is not active record
i trying manually enter
 <form>
im my code but again not displaing.... :(
any ideas ?
0

#2 User is offline   acainoks 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 16-November 10
  • Location:Poznań - Poland

Posted 27 September 2013 - 06:17 PM

when duplicate code, it only appears in the second <form>
Why?!

<div id="addItemToDay" title="Dodaj product">
  <div class="form">
    <div class="row">
    <input id="AddToDay_id" type="text" name="AddToDay[id]" value="0" style="display:none;">
    <input id="AddToDay_type" type="text" name="AddToDay[type]" value="product" style="display:none;">
    <input id="AddToDay_name" type="text" name="AddToDay[name]" style="display:none;">
    <div class="row">
    <div class="row">
    <div class="row buttons">
  </div>
  <div class="form">
    <form id="addItemDay-form" method="post" action="/fitgame/index.php?r=day/addProductValue&id=106">
      <div class="row">
        <input id="AddToDay_id" type="text" name="AddToDay[id]" value="0" style="display:none;">
        <input id="AddToDay_type" type="text" name="AddToDay[type]" value="product" style="display:none;">
        <input id="AddToDay_name" type="text" name="AddToDay[name]" style="display:none;">
        <div class="row">
        <div class="row">
        <div class="row buttons">
    </form>
  </div>
</div>

0

#3 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,047
  • Joined: 16-February 11
  • Location:Japan

Posted 27 September 2013 - 08:07 PM

Hi acainoks,

The code fragment you posted looks fine at first glance.
The error might be in another part of your view file that encloses the form, probably a missing opening or closing 'div'.
0

#4 User is offline   acainoks 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 16-November 10
  • Location:Poznań - Poland

Posted 28 September 2013 - 03:38 AM

yes softark, thanks :rolleyes:
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