Need sfwidgetformtextarea syntax
I want to write the following HTML in symfony forms.
<textarea name="styled-textarea" onfocus="this.value=''; setbg('#e5fff3');" onblur="setbg('white')">Enter your comment here...</textarea>
Please开发者_JAVA百科 show me the exact sfwidgetformtextarea syntax for the above HTML textarea. Thanks in advance
You must create new Class extending a symfony class for forms.
class YourForm extends sfBaseForm{
`public function setup(
'your_field_name' => new sfWidgetFormInputText(array(),array('name'=>"styled-textarea",'onfocus'=>"this.value='';setbg('#e5fff3');",onblur=>"setbg('white')",'value'=>"Enter your comment here......"))
);`
Then just make instances of your class in the your views, good luck
精彩评论