Solved

OnClick of button, get data from database and populate HTML table

Posted on 2004-10-19
4
357 Views
Last Modified: 2013-12-20
Hello fellow ColdFusion programmers.

I'm still somewhat of a novice at ColdFusion.
I have an HTML table on an HTML form. When a user selects the data that he's interested in (date ranges and so forth) and clicks a button on the form to retireve the data,  I want to populate the HTML table with data from a SQL Server database. There could be potentially tens of thousands of records or only a few, so I don't want to get the data until the user has selected the data parameters. Is a hidden frame the best solution?

Thanks

0
Comment
Question by:Owolowo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
kkhipple earned 125 total points
ID: 12354175
no u dont need a hidden frame.

the user would select the specified criteria (ie. date range) and that form would submit back to itself (or an action page) and from there you can print out the results.

<CFQUERY DATASOURCE="source" NAME="queryNAme">
   SELECT col1, col2, ...
   FROM tableName
   WHERE ....
</CFQUERY>

<CFOUTPUT QUERY="queryNAme">
   #col1# #col2# ... <BR>
</CFOUTPUT>

OR

<TABLE>
  <CFOUTPUT QUERY="queryNAme">
   <TR><TD>#col1#</TD> <TD>#col2#</TD> ...</TR>
  </CFOUTPUT>
</TABLE>
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 12354307
Hello Owolowo!

Yah! I agree with kkhipple.  Submit it to the same page.

Most probably, this would be your guide to create the file :

<form action="" method="post">
  <cfif IsDefined('form.viewRecord')>
    <cfquery name="GetRecord" datasource="DSN">
      Select * From TableName
      Where columnName = '#form.selectDate#'
    </cfquery>
    <!--- Your table here as what kkhipple suggested --->
  </cfif>

  <input type="text" name="selectDate" value="defaultvalue">
  <input type="submit" name="viewRecord" value="View">
</form>

Hope this helps.


Goodluck!
eNTRANCE2002 :-)
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question