Inserting Content in textArea


<?php echo $form->textArea($model, 'description', array("class"=>"contact-textarea", "id"=>"txtEnquiry", 'content'=>'Type your comments in here...')); ?>



generates


<textarea name="LandlordRent[description]" content="Type your comments in here..." id="txtEnquiry" class="contact-textarea"></textarea>

I’m trying to generate this


<textarea onfocus="javascript:autoHide(this,'Type your comments in here...');" onblur="javascript:autoHide(this,'Type your comments in here...');" name="txtEnquiry" id="txtEnquiry" class="contact-textarea">Type your comments in here...</textarea>

Need the content "Type your comments in here…" between the tags

heh




<?php 

$defaultTxt='Type your comments in here...';

if(empty($model->description))

   $model->description=$defaultTxt;


echo $form->textArea($model,'description',array("name"=>"txtEnquiry","id"=>"txtEnquiry","class"=>"contact-textarea", "onblur"=>"javascript:autoHide(this,'".$defaultTxt."')","onfocus"=>"javascript:autoHide(this,'".$defaultTxt."')"));


?>



The documentation is there for a reason …

didn’t you want to use actually a placeholder instead of content?




<?php echo $form->textArea($model,'notes',array('rows'=>6, 'cols'=>50,'placeholder'=>'You should write down notes here')); ?>