This is the solution which i came up with to this.I was first created a seperate form class by extending symfony base form.At that point my form didn't worked.So i added the form's attributes inside the controller's action method instead of defining it in a seperate file.Now it's working fine.
class loginActions extends sfActions
{
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
$this->form = new sfForm();
$this->form->setWidgets(array(
'name' => new sfWidgetFormInputText(),
'password' => new sfWidgetFormInputPassword(),
));
}
}