Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Methods to autofilling data

I have a JSON database with information that I would like to autofill in my JavaScript/HTML if a particular element in the array is found. I have an handler event, onchange to listen if that particular element is found, it prints all of the info of that particular array. I have it printing into the console, but how would I go about printing this onto my relevant HTML sections?

Are there any documents I should be looking at to help me with this?

The javascript

const getAssetInfo = id => {
    $.get( "http://localhost:3000/assets/" + id, function( data ) {
        console.log(data);  
    });
}
$('document').ready(() => {

                    <td><input id='asset_tag_no${count}' type='text' onchange = "getAssetInfo(this.value);" bottom required /></td>
                    <td><input id='manufacturer_serial_no${count}' type='text' bottom required/></td>
                    <td><textarea id='description${count}' type='text' bottom required description></textarea></td>
}

The database

{
    "assets" : [
        {
            "id": "0946",
            "description" : "SONY - Camera",
            "manufacturer" : "SONY",
        }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!