Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Laravel 5.0 Getting Old Values In the form

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 504
    Comment on it

    Many times we need to show our old values in a form after an error or validation stops our form from submitting. Laravel has a very nice way of retaining old values and populating it back into our form.

    I myself used it in a drop down, where I want to show the user the same selected value again when form did not submit properly.

    1. Syntax :-

    2.  
    3. Simple Form Syntax
    4. <input type="email" class="form-control" name="email" value="{{ old('email') }}">
    5.  
    6. Laravel Form Syntax
    7. {!! Form::text("email", old('email'), array("placeholder" => "Your Valid Email Address")) !!}

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: