Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to perform lookup from textfield value and populate form elements without reloading page?
    primarykey
    data
    text
    <p>I have a very simple Form which has a textfield called <code>CustomerNumber</code>. There are other elements in the Form such as selects and lists that need to contain values related to the <code>CustomerNumber</code>.</p> <p>All I want to do is:</p> <ol> <li>User enters in a value into the <code>CustomerNumber</code> textfield and then 'tabs' out or just clicks somewhere else on the page </li> <li>the value entered in <code>CustomerNumber</code> should then be passed as to a database query which will return the results that are based on the <code>CustomerNumber</code> value (e.g. customer's previous orders)</li> <li>The results from the database query are used to populate the other Form elements</li> <li>Finally once the user has filled in the form correctly, they will submit the entire form (including the CustomerNumber) to the server for processing</li> </ol> <p>I just had a little look at JQuery and tried some simple DOM manipulation (e.g. <code>paragraph.text("new value")</code>) and the first I noticed is that none of the HTML in the Sourcecode gets changed. Within the browser I can see the change but not in the HTML. </p> <p>This leads me to wonder that if I user JQuery to manipulate Form elements (through an AJAX call or something - I don't know Jquery yet), how will the database data returned from the AJAX call populate the Form elements and how will it actually get submitted to the server when they don't exist in the HTML? </p> <p>I tried doing it using just HTML forms and have a submit button next to the <code>CustomerNumber</code> textfield and do a self-submit page, but that would mean having a Form within a Form which isn't possible...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload