Old input in user registration field

keevitaja - 1 year ago

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 - 1 year ago

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

keevitaja - 1 year ago

Nope, this is not working.

PS! i have rebinded the register to my custom RegisterFormBuilder

keevitaja - 1 year ago

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

PS! post editing is still throwing 500

ryanthompson - 1 year ago

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

keevitaja - 1 year ago

http://i.imgur.com/s6w5RmR.png

keevitaja - 1 year ago

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

ryanthompson - 1 year ago

Try using {{ request_old() }}

keevitaja - 1 year ago

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

keevitaja - 1 year 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 - 1 year 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