jeudi 18 avril 2019

Dropdown based on one table passing to other fields using ajax laravel

I'm having problem with regards to selected dropdown passing fields value to other input.

Basically I have one table (plans) which have id, plan_name, price. So i want to pass price to the other input.

So I expect the output that if I selected one of the choices the price will be on the price input.

<div class="control-group">
                <label class="control-label">Plan</label>
                    <div class="controls">
                      <select name="plan_id" id="plan_id" class="plan" style="width:220px">
                          <option value="0">Select</option>
                          @foreach($plans as $plan)
                      <option value="" ></option>
                          @endforeach
                      </select>
                </div>
              </div>
              <div class="control-group">
                  <label class="control-label">Price</label>
                  <div class="controls">
                    <input class="plan_price" type="number" name="price" id="price">
                  </div>
               </div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire