Owolowo
asked on
OnClick of button, get data from database and populate HTML table
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 :-)