I have patients information in database, now I want to access one's information in another form. When I will input patient's ID the patient name field need to be filled/loaded automatically. I have my Patient model also.
This is the from...
<form method="post" class="" action="" >
@csrf
<div class="input-field col s3">
<input name="patient_id" id="id" type="text" class="validate">
<label class="active" for="id">Patient ID</label>
</div>
<div class="input-field col s9">
<input name="patient_name" id="name" type="text" class="validate">
<label class="active" for="name">Patient Name</label>
</div>
<div class="input-field col s12">
<select name="room">
<option value="" disabled selected>Select Room</option>
<option value="2001">ROOM 2001 - Non AC - 500</option>
<option value="4001">ROOM 4001 - AC -800</option>
<option value="301">CABIN 301 - AC - 1700</option>
</select>
</div>
<div class="input-field col s12 text-center">
<button class="btn waves-effect waves-light" type="submit" name="action">Assign Room</button>
</div>
</form>