Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- label(for='unit_number') Unit Number
- .form-group
- select.form-control(name="unit_number",
- id="unit_number",required=true)
- option(value='') Select Unit Number
- $.ajax({
- type: 'POST',
- data: JSON.stringify(data),
- contentType: 'application/json',
- url: 'http://localhost:8082/location/getUnitNbrs',
- success: function (data) {
- for (var j = 0; j < data.length; j++) {
- $('#unit_number').contents().remove();
- var newOption = $('<option/>');
- console.log(data[j]);
- newOption.attr('text', data[j]);
- newOption.attr('value', data[j]);
- console.log(newOption);
- $('#unit_number').append(newOption);
- }
- }
- });
Add Comment
Please, Sign In to add comment