Tuesday, March 14, 2017

How to populate the form fields based on drop down selection?

I have a form with input fields: name and description. The name field is a drop down. based on the name selected the description needs to change. I have made the drop down to populate the names already.

<form>
<select name="name" >
@foreach($books as $book)
<option value=""></option>
@endforeach
</select>

how do i change the description field based on the selected drop down?

<input type="text name="description" value=">



via Mikethetechy

Advertisement