I have a salary adding form, where I have to manually type in the rate for the morning and night shifts for every company. Every company have different rates. I want to make it as when the company's name is chosen, the rates should be retrieved from the database using php and fill in automatically so that the user only has to input how many days the labourer has worked. I'm not sure of how to implement this. Every company's rates are stored in a database. How to do the jquery to make this idea work?
<input type="text" name="name">
<div>
<label>Morning Shift Rate: </label>
<input type="number" name="morning_rate"
id="morning_rate">
<label> Days : </label>
<input type="number" name="morning_day" id="morning_day">
</div>
<div>
<label>Night Shift Rate: </label>
<input type="number" name="night_rate" id="night_rate">
<label> Day : </label>
<input type="number" name="night_day" id="night_day" >
</div>
<script>
$(document).ready(function(){
$('#name').click(function(){
????
})
})
</script>