Jump to:

5539 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Confirmation message on custom forms

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1225 Views
  • pbertrand
    Avatar
    Community Member
    8 Posts

    Confirmation message on custom forms Link to this post

    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.

  • pbertrand
    Avatar
    Community Member
    8 Posts

    Re: Confirmation message on custom forms Link to this post

    Found we must use a ConfirmedFormAction:

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

    1225 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.