Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Display data from database inside a readonly textfield

so I am trying to show the first, middle and last name used in registration here. how should I do it? I am new to laravel so it is my first time encountering this scenario

 <div class=" overflow-auto">
                <div class="p-3">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title text-info"><strong> Step 1 (Application Form: Personal Information)</strong></h4>
                            <div class="row">
                                    <div class="col-sm-12 col-lg-4">
                                        <div class="form-group row">
                                            <label for="firstName" class="col-sm-3 text-right control-label col-form-label">First Name</label>
                                            <div class="col-sm-9">
                                            <input class="form-control" type="text" id='firstName'  readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-lg-4">
                                        <div class="form-group row">
                                            <label for="middleName" class="col-sm-3 text-right control-label col-form-label">Middle Name</label>
                                            <div class="col-sm-9">
                                            <input class="form-control" type="text" required="" placeholder="Middle Name" id='middleName'  readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-lg-4">
                                        <div class="form-group row">
                                            <label for="lastName" class="col-sm-3 text-right control-label col-form-label">Last Name</label>
                                            <div class="col-sm-9">
                                            <input class="form-control" type="text" required="" placeholder="Last Name" id='lastName'  readonly>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <a href="step2" class="btn waves-effect waves-light btn-success"  style="float:right;">Next</a>
                </div>
            </div>
        </div>
    </div>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Pass your variables into your views, and echo like this :

<input class="form-control" type="text" value="{{ $firstName }}" id='firstName'  readonly>

You must read more about blade templates.

https://laravel.com/docs/9.x/blade#displaying-data

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading