It's pretty simple .. you created a class which extends sfForm?!
If so you just have to implement the configure()-function where you
can create widgets (I hope you did that so far).
With $this->setValidators you can specify validators for each widget
or you can add a post validator.
little example
[code]
class emailForm extends sfForm
{
public function configure()
{
$this->setWidgets(array(
"email" => new sfWidgetFormInput(),
));
$this->widgetSchema->setLabels(array(
"email" => "E-Mail",
));
$this->setValidators(array(
"email" => new sfValidatorEmail(array(),
array("invalid" =>
"Invalid email"))
));
}
}
[/code]
On 31 Mrz., 12:51, Prashanth <[email protected]> wrote:
> Thank you Very much For your Reply.
> And iam in little confusion where i have to write that code.
> Please Can you give the Example.
>
> On Mar 23, 8:26 pm, Fási Gábor <[email protected]> wrote:
>
> > You can use the validators described in the Forms book, appendix
> > Bhttp://www.symfony-project.org/book/forms/1_2/en/B-Validators
> > they can be used w/o the form framework.
>
> > On Mon, Mar 23, 2009 at 07:10, Prashanth <[email protected]> wrote:
>
> > > Hi All,
>
> > > iam working with symfony 1.2.
> > > i have created the forms without using the widgets.
> > > So please can any one help me How Can i validate the Form in
> > > Symfony1.2.
> > > Thanks in Advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---