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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Confirmation message on custom forms


Go to End


2 Posts   1943 Views

Avatar
pbertrand

Community Member, 8 Posts

28 April 2009 at 3:57am

Edited: 28/04/2009 3:58am

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

Community Member, 8 Posts

29 April 2009 at 12:16am

Found we must use a ConfirmedFormAction:

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