Level 122
what have you tried?
Hello..
Struggling to create auto complete forms, where selecting one of the dropdown auto completes other related fields.
Form has 3 Input fields, which are drop down select fields, When User selects Employee number or phone number (any of one) form auto fills First-Name, Last-Name and email (3 fields are view purpose only non editable.)
Controller:
$employee_numbers = VesselData::pluck('employee_number', 'id');
first_names = VesselData::pluck('first_name', 'id');
$phonenums = VesselData::pluck('phone', 'id');
return view('fieldworkcreate', compact('employee_numbers', 'first_names', 'phonenums' ));
View Blade file fieldworkcreate is a form to fetch employee data from existing records, then update office, work location. Saving form will save to table 2. Employee list already populated in database.
Table 1 - Employee:
ID EMPNUM FIRSTNAME LASTNAME PHONE EMAIL
1 007 JANE DOE 001007 janedoe@
Table 2 - FieldworkData
ID EMPID DEPARTMENTID OFFICELOCID ONSITE
1 1 2 3 0
Thank You Suds
Please or to participate in this conversation.