Old input in user registration field
Created 7 years ago by keevitaja

How to get the old input in register.twig form? request_old nor the session will work

            {% set register = form('register').get() %}

            {{ register.open({'class': 'form'})|raw }}
                <div class="form-group">
                    <label for="email">{{ trans('labels.email') }}</label>
                    <input type="text" name="email" id="email" value="{{ what the hell should i write here???? }}">               
                </div>
lckamal  —  7 years ago

You can write {{ register.fields.email.value }}

keevitaja  —  7 years ago

Nope, this is not working.

PS! i have rebinded the register to my custom RegisterFormBuilder

keevitaja  —  7 years ago

... get some custom functionality like password confirmation and other stuff

PS! post editing is still throwing 500

ryanthompson  —  7 years ago

@keevitaja when you say 500.. again this means absolutely nothing. Give us some details or we can't help you.

keevitaja  —  7 years ago

@ryanthompson any idea how to get old input in the overwritten register.twig? First post of this topic has the twig code

ryanthompson  —  7 years ago

Try using {{ request_old() }}

keevitaja  —  7 years ago

I have tried everything. Literally everything. Even checked that the old input gets flashed. But nothing.

keevitaja  —  7 years ago

Now i found out, that in case user types some gibberish (something that does not validate as an email) for the email, it does not remember the old value.

Any idea how to fix this?

keevitaja  —  7 years ago

still 500 on editing the post...

But i cracked this. In form builder

        'email'        => [
            'type' => 'anomaly.field_type.text',
            'instructions' => false
        ],

And boom, it is remembering the old value