Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

ConfirmedPasswordField validation messages not working :( #1

Open
nimeso opened this issue Apr 23, 2014 · 10 comments
Open

ConfirmedPasswordField validation messages not working :( #1

nimeso opened this issue Apr 23, 2014 · 10 comments

Comments

@nimeso
Copy link

nimeso commented Apr 23, 2014

Seems that $Message is not working?

@jeffwhitfield
Copy link
Owner

Let me update the form templates and see if that does the trick. Since the form templates are the only thing that's different, that's probably what's causing the problem. Need to look at it closer but a quick look reveals that SilverStripe might require an explicit "$" on variables when used in a conditional, which currently isn't reflected in the templates. Will post up some changes soon.

@nimeso
Copy link
Author

nimeso commented Apr 29, 2014

Hey Jeff :)

Any luck finding 5 minutes to look at this issue? I have a website ready to go live and this is the only issue I still have. I've had a look at the Templates and can't see anything wrong... confused .com :( cheers heaps buddy!

@jeffwhitfield
Copy link
Owner

Hola!

Can you give me a little more insight into how you’re using the $Message variable? What template are you using and how is it being used? Is it a script that utilizes the Form.ss template?

One thing you could do is kill the forms directory in the Templates directory of your theme and see if it still breaks. Everything should work, although you’ll probably need to add back whatever form templates you need and customize the markup to work with Bootstrap. It’s possible that the $Message variable is working but requires a class to be present for the validation js to work right. Probably something I overlooked. :P

Jeff

On Apr 29, 2014, at 2:52 PM, nimeso [email protected] wrote:

Hey Jeff :)

Any luck finding 5 minutes to look at this issue? I have a website ready to go live and this is the only issue I still have. I've had a look at the Templates and can't see anything wrong... confused .com :( cheers heaps buddy!


Reply to this email directly or view it on GitHub.

@nimeso
Copy link
Author

nimeso commented Apr 29, 2014

Hey Jeff! thanks man

yes I have tried turning off the forms folder in my theme and the ConfirmedPasswordField messages work fine... as soon as I turn on the form templates it stops working :( I'm not even sure which template ConfirmedPasswordField uses?... thinking its FieldGroup_holder.ss ?

I wish I could give you more info... I'll have another look and see if I can debug it

@jeffwhitfield
Copy link
Owner

I'll see what I can do as well. Will need to setup a mockup of the ConfirmedPasswordField functionality. Is the an adding that uses this?

On Apr 29, 2014, at 3:05 PM, nimeso [email protected] wrote:

Hey Jeff! thanks man

yes I have tried turning off the forms folder in my theme and the ConfirmedPasswordField messages work fine... as soon as I turn on the form templates it stops working :( I'm not even sure which template ConfirmedPasswordField uses?... thinking its FieldGroup_holder.ss ?

I wish I could give you more info... I'll have another look and see if I can debug it


Reply to this email directly or view it on GitHub.

@nimeso
Copy link
Author

nimeso commented Apr 29, 2014

Sorry Jeff... whats does ' Is the an adding that uses this?' mean ;)

@jeffwhitfield
Copy link
Owner

Sorry. I was asking if there was an addon that uses the same functionality you're using.

On Apr 29, 2014, at 3:13 PM, nimeso [email protected] wrote:

Sorry Jeff... whats does ' Is the an adding that uses this?' mean ;)


Reply to this email directly or view it on GitHub.

@nimeso
Copy link
Author

nimeso commented Apr 29, 2014

Ok, sorry... I just deleted my last post, I was using the wrong website, lol...

ok... as a simple test, pop this into your Page.php class and you can see what I mean.

private static $allowed_actions = array (
        'doForm',
        'Form'
    );

public function Form(){

         $fields = new FieldList(
            new ConfirmedPasswordField('Password', 'Password')
        );
        $actions = new FieldList(
            new FormAction('doForm', 'Submit')
        );
        $validator = new RequiredFields('Password');    
        $Form = new Form($this, 'Form', $fields, $actions, $validator); 
        return $Form;

    }

    public function doForm(){
        Debug::dump("yes");
    }

@mrguits
Copy link

mrguits commented May 13, 2016

I don´t know if this is solved - but I changed "FormField_holder" to make a message appear on
ConfirmedPasswordField

<% if Title %>

<% if Title %>$Title<% else %><% end_if %>
$Field
<% if Message %>$Message<% end_if %>

<% else %>
<% if Message %>$Message<% end_if %>
$Field
<% end_if %>

@jeffwhitfield
Copy link
Owner

Gonna review this soon and make any updates necessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants