Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:30:32+00:00 2026-05-29T13:30:32+00:00

I have a particular issue. The data inside of my HTML <input> elements is

  • 0

I have a particular issue. The data inside of my HTML <input> elements is loaded from a database.

As result, when I try to obtain the value of these input boxes to use in the below function, “obtainAPIData”, it returns undefined because the values have not loaded yet.

I need to wait for the input fields to populate with the data from the database – before I use .val()

var weight = $('#letterhead_weight').val();
var size = $('#letterhead_size').val();
var type = $('#letterhead_type').val();

obtainAPIData('get_letterhead', '#product_info', 'JSON', type, weight, size);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:30:33+00:00Added an answer on May 29, 2026 at 1:30 pm

    How is your data being pulled from the database?

    If it’s synchronous to the page you could just wrap it in a document.ready style call in order to wait for the page to fully load before firing.

    $(function(){
       var weight = $('#letterhead_weight').val();
       var size = $('#letterhead_size').val();
       var type = $('#letterhead_type').val();
    
       obtainAPIData('get_letterhead', '#product_info', 'JSON', type, weight, size);
    });
    

    If it’s an async call you’ll need to put a callback function on your database retrieval routine in order to fire your JS when it’s complete.

    $.ajax({
      type: 'POST',
      url: url,
      data: data,
      success: function() { 
          var weight = $('#letterhead_weight').val();
          var size = $('#letterhead_size').val();
          var type = $('#letterhead_type').val();
    
          obtainAPIData('get_letterhead', '#product_info', 'JSON', type, weight, size); 
      },
      dataType: dataType
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of input elements that have a particular substring in their
I have forms posting data from instances of a particular abstract class: public abstract
Stuck with this particular issue. I have code that get lots of pages from
I have recently run into a particularly sticky issue regarding committing the result of
The JQuery has method effectively selects all elements where they have particular descendants. I
I have one particular FLA that is crashing every time I try to compile
I have an issue with a particular controller action not displaying the view. Here
I have a web-site that generates some simple tabular data as html tables, many
we have an issue with an access database we are upgrading to use SQL
I have a datagrid that is displaying data that is being returned from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.