Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Confirmation message on custom forms


Reply

2 Posts   1238 Views

Avatar
pbertrand

28 April 2009 at 3:57am (Last edited: 28 April 2009 3:58am), Community Member, 8 Posts

Hello, i've got a custom form of this type :

         $fields = new FieldSet(
         new TextField('Email'),
         new PasswordField("Password"),
         new LabelField("Forgot your password ?'.")
         );
         // Création des actions
         $actions = new FieldSet(
            new FormAction('doLogin', 'Login'),
            new FormAction('generateNewPass', 'Forgot my password')
         );
         $validator = new RequiredFields('Email', 'password');
      
      return new Form($this, 'loginForm', $fields, $actions, $validator);

I wan't to put a confirmation message on the "Forgot my password" button.
Does anyone know how to do this ?

thanks.

Avatar
pbertrand

29 April 2009 at 12:16am Community Member, 8 Posts

Found we must use a ConfirmedFormAction:

// Création des actions
$actions = new FieldSet(
new FormAction('doLogin', 'Login'),
new ConfirmedFormAction('generateNewPass', 'Forgot my password')
);