Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generating table based on database resultset

Status
Not open for further replies.

danglingpointers

Technical User
Jul 29, 2005
18
US
I would like to be able to use a single page that would be able to refresh a table based on the input into a text box and after clicking a button. Here is what I have thus far:

Code:
<form>
<input type="text" name="qstr">&nbsp&nbsp&nbsp&nbsp
<input type="button" value="Search" onClick="foo(document.forms[0].qstr.value)">
</form>

<script>
function foo(val){
document.writeln(val);
};
</script>

foo() was just a test, what I would like to do is take an entire resultset (which I will generate inside of foo()) and write it into a table within the same page that contains the input text box and button. I have already taken care of the database logic, so that is of no concern. However, the document.writeln(val) creates a new window when it runs but I would like to keep the table on the same page and be able to refresh its contents when the user enters a new value in the text box and presses the button.

Also, I would presume that a simple modification to this solution would allow me to populate text boxes with my resultset as well?

I hope that is somewhat clear. All of your responses to my previous posts have really aided my javascript learning curve quite well. Thanks in advance.

- Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top