Fill in data from a select

0

I am trying to load the respective data of an article by means of its id, from the registration form, where this information will only be visible, it will not be able to modify it. I have already tried several ways but I can not achieve my goal, someone who can help me.

onchange of the combobox

<div class="col-md-9 ml-auto">
     <label>Item Description</label>
     <select onchange="displayInformation(this.value)" class="form-control" id="descriptionItem"></select>
     <br>
</div>


//function
function displayInformation(numFile){    
    console.log(numFile);
    $.ajax({
        url: 'http://localhost/WareHouse/apis/receipt.php?numFile='+ numFile,
        type: "GET",
        success:function(data)
        {
        FullDates();
        }
    });
}

This is where I am trying to assign the information to each input

function FullDates(image,cat_name,idSub,numFile,name_category,name_sub,name_unit,name_location,
model_item,quantity,price_item,company_supplier,manufacturer,commentt,name_engineer)
{
console.log("Entre a FullDates");
console.log(numFile);

        document.getElementById("imagenEditar").src = "http://localhost/WareHouse/assets/img/" + image;
        document.getElementById("reciNumPart").value =  cat_name+"-"+idSub+"-"+numFile;
        document.getElementById("reciCategory").value = name_category;
        document.getElementById("reciSubItem").value = name_sub;
        document.getElementById("reciUnit").value = name_unit;
        document.getElementById("reciAreas").value = name_location;
        document.getElementById("reciModel").value = model_item;
        document.getElementById("AllQuantity").value = quantity;
        document.getElementById("reciPrice").value = price_item;
        document.getElementById("reciSupplier").value = company_supplier;
        document.getElementById("reciManufacturer").value = manufacturer;
        document.getElementById("reciComment").value = commentt;
        document.getElementById("ReciEngineer").value = name_engineer;    
        }

    
asked by user103750 16.10.2018 в 20:56
source

1 answer

-1

By clicking on an option of the select, which I want your information to be loaded, if it is caching your id, and enters fullDates which will put your information in the input ... that is the result of the data, if you return your information, however they remain indefinite in the form

Here is my function where I send my api call, and then the function that will assign the information to the input, sincerely I do not know if it is the correct way, I am already confused with so many things that I have tried

    
answered by 16.10.2018 в 21:50