Sandeep
Sandeep

Reputation: 663

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 show me the exact sfwidgetformtextarea syntax for the above HTML textarea. Thanks in advance

Upvotes: 0

Views: 486

Answers (1)

Andreu Ramos
Andreu Ramos

Reputation: 2908

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

Upvotes: 1

Related Questions