php - laravel 在文本框中实时搜索并自动填充到其他文本框
问题描述
我一直在寻找并尝试使用 youtube 和一些网站上的教程,以便在文本框中进行实时搜索并自动填充到其他文本框。它对我不起作用 TT希望任何人都可以分享任何使用电话号码进行实时搜索的教程,因为我找不到它。我正在使用 laravel 7,sqlyog
我会在这里解释
- 这是订购单。我想实时搜索电话号码,一旦我输入了现有的电话号码,姓名将自动填写。 命令
这是我的模型客户
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Customer extends Model
{
public $table = "customers";
protected $fillable = [
'custPhone', 'custName',
];
}
这是表格
@extends('layouts.template')
@section('content')
<form action="#" class="mt-3" method="POST" >
@csrf
<div class="col-sm-12 " >
<div class="card">
<div class="card-body">
<h3 class="card-title">Create Order</h3>
<!--<h6 class="card-subtitle">To use add <code>is-valid</code> class to the input</h6>-->
<label class="form-control-label" >Order Date</label>
<input type="text" class="form-control" value="{{ now("Asia/Kuala_Lumpur")->toDateString() }}" readonly></br>
<label class="form-control-label" >Phone Number</label>
<input type="text" class="form-control" maxlength="12"> </br>
<label class="form-control-label" for="inputSuccess1">Name</label>
<input type="text" class="form-control" ></br>
<h4 class="card-title">Service</h4>
<table class="table mb-0">
<thead class="table-success">
<tr>
<th scope="col">Type</th>
<th scope="col">Weight/Measurements</th>
</tr>
</thead>
<tbody>
<tr>
<td><div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Wash and Fold</label>
</div>
</td>
<td>
<input type="text" class="form-control" placeholder="weight" >
</td>
</tr>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck2">
<label class="custom-control-label" for="customCheck2">Dry Cleaning</label>
</div>
</td>
<td>
<input type="text" class="form-control" placeholder="quantity" >
</td>
</tr>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck3">
<label class="custom-control-label" for="customCheck3">Iron</label>
</div>
</td>
<td>
<input type="text" class="form-control" placeholder="quantity" >
</td>
</tr>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck4">
<label class="custom-control-label" for="customCheck4">Blanket/Curtain Cleaning</label>
</div>
</td>
<td>
<input type="text" class="form-control" placeholder="quantity" >
</td>
</tr>
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck6">
<label class="custom-control-label" for="customCheck6">Carpet Cleaning</label>
</div>
</td>
<td>
<input type="text" class="form-control" placeholder="measurements" >
</td>
</tr>
</tbody>
</table>
<label class="form-control-label" >Total</label>
<input type="text" class="form-control" disabled > </br>
<div class="form-actions">
<div class="text-right">
<button type="submit" class="btn btn-info">Submit</button>
<button type="reset" class="btn btn-dark">Reset</button>
</div>
</div>
</div>
</div>
</form>
@endsection