开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜