How we can display ajax response in dropdown filed of orm in jsp

How we can display ajax response in dropdown filed of orm in jsp

sunilithapesunilithape Posts: 2Questions: 1Answers: 0

$(document).ready(function() {

$.ajax({
    type: "POST",
    url: "/VehicleDataController",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
     $.each(data, function (i, val) { 
       console.log(val.name);
       $("#vehicleID").text(val.vehicleIMEIID);
       $("#vehicleRg").text(val.vehReg);

    });
 }
});

});

Answers

  • sunilithapesunilithape Posts: 2Questions: 1Answers: 0
    <tr>
          <td> Vehicle Reg. :  </td> 
          <td>
          <select name="selectVehicleReg" id="vehicleRg">
          for (var i = 0; i < data.vehReg; i++) {
          <option value="data[i].localidad_cve"> data[i].vehReg </option>
    
          </select></td>
      </tr>
    
This discussion has been closed.