mercredi 5 octobre 2016

Laravel : How to send variable form one page to another in blade

I'm building a laravel application where form The first page I want to send a variable or say value to second page in a form ..How do I do it?

Let's say In my first page ..I have following value ..

<li> <a  href="">A</a> </li>
 <li> <a href="" >B</a> </li> 

When a user click on the button second page will appear ..Where I'm gonna submit a form where course_id will come from the first page means the <a> tag

Here is my form demo:

{!! Form::open(array('route' => 'postRegistration','class'=>'form-horizontal','method'=>'POST'))  !!}
                                {!! Form::token(); !!}
                                {!!   csrf_field() ; !!} 

                             <div class="form-group">
                                        <label class="sr-only" for="form-first-name">Name</label>
                                        <input type="text" name="name" placeholder="Name..." class="form-first-name form-control" id="form-first-name">
                              </div>
                              <div class="form-group">
                                <label class="sr-only" for="form-email">Email</label>
                                <input type="text" name="email" placeholder="Email..." class="form-email form-control" id="form-email">
                              </div>
                              <div class="form-group">
                                <label class="sr-only" for="form-first-name">Phone</label>
                                  <input type="text" name="phone_no" placeholder="Phone..." class="form-first-name form-control" id="form-first-name">
                                </div>
                                <div class="form-group">
                                  <label class="sr-only" for="form-first-name">Date Of Barth</label>
                                    <input type="date" name="dob" placeholder="Date of barth..." class="form-first-name form-control" id="form-first-name">
                                  </div>
                                    <div class="form-group">
                                        <label class="sr-only" for="form-last-name">Fathers Name</label>
                                        <input type="text" name="f_name" placeholder="Fathers Name..." class="form-last-name form-control" id="form-last-name">
                                    </div>
                              <div class="form-group">
                                <label class="sr-only" for="form-last-name">Address</label>
                                <textarea rows="4" style="height:100px;" name="address" placeholder="Address..." class="form-last-name form-control" id="form-last-name"></textarea>
                              </div>
                                    <button type="submit" class="btn">Submit</button>
                                {!! Form::close() !!}

How do I do it in Laravel?

Any suggestion or solution please?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire