keevitaja - 2 years 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 - 2 years ago

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

keevitaja - 2 years ago

Nope, this is not working.

PS! i have rebinded the register to my custom RegisterFormBuilder

keevitaja - 2 years ago

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

PS! post editing is still throwing 500

ryanthompson - 2 years ago

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

keevitaja - 2 years ago

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

keevitaja - 2 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 - 2 years ago

Try using {{ request_old() }}

keevitaja - 2 years ago

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

keevitaja - 2 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 - 2 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