Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming that the data is being returned (your <code>stateChanged</code> method is being invoked) you need to dynamically create the table rows (and their contents, the text boxes) in your <code>stateChanged</code> method by modifying the DOM.</p> <p>To modify the DOM to create the table structure the code should read something like this (assuming you've already removed the previously displayed rows):</p> <pre><code>var table = document.getElementById('tableId'); var data = xmlHttp.responseText.split(":"); for (int i = 0; i &lt; data.length; i + 2) { var valueText = document.createElement('input'); valueText.type = 'text'; valueText.name = 'value' + i; valueText.value = data[i]; var valueCell = document.createElement('td'); valueCell.appendChild(valueText); var descriptionText = document.createElement('input'); descriptionText.type = 'text'; descriptionText.name = 'value' + i; descriptionText.value = data[i + 1]; var descriptionCell = document.createElement('td'); descriptionCell.appendChild(descriptionText); var tableRow = document.createElement('tr'); tableRow.appendChild(valueCell); tableRow.appendChild(descriptionCell); table.tBodies[0].appendChild(tableRow); } </code></pre> <p>Also, as @TrueDub said, putting SQL in JSPs is bad for a whole host of reasons. What's worse is building SQL queries with string concatenation - it opens your system to SQL injection attacks, especially when the string being concatenated includes a string captured in the browser.</p>
 

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