Old input in user registration field

keevitaja - 8 months 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 - 8 months ago

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

keevitaja - 8 months ago

Nope, this is not working.

PS! i have rebinded the register to my custom RegisterFormBuilder

keevitaja - 8 months ago

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

PS! post editing is still throwing 500

ryanthompson - 8 months ago

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

keevitaja - 8 months ago

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

keevitaja - 8 months ago

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

ryanthompson - 8 months ago

Try using {{ request_old() }}

keevitaja - 8 months ago

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

keevitaja - 8 months 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 - 8 months 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