Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Filtering cfquery dinamically

Guest
Oct 06, 2008 Oct 06, 2008
I am trying to update query values wihtout refreshing the page. I want to do all this through a input text when the value changes.

Example
<cfparam name="inputfield" default="0">

<cfquery name="getCols" datasource="#Application.DSN#">
SELECT COL1, COL2
FROM TABLE
WHERE COL1 = #inputfield#
</cfquery>

<cfform name="form">
<!---Input field that depends on the value will change the filterign on the query-->
<cfinut type="text" name="inputfield">

SKU Product: #getColumns.Col1#
Name Product: #getColumns.Col2#
</cfform>
TOPICS
Database access
490
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2008 Oct 06, 2008
ayuso_15 wrote:
> I am trying to update query values wihtout refreshing the page. I want to do
> all this through a input text when the value changes.

That is not even close to what is required for this concept. That query
runs on the server. The input and the user interacting with it run on
the client. And never will the two meet without a refresh.

If you are working with a small data set or a large pipe, such as a
corporate intranet, you could deliver the entire record set as a
JavaScript array. And then use basic JavaScript functionality to
display a view of this, updated by the input control without a refresh.

If that is not workable, which it seldom is, you can hide the 'refresh'
behind the scenes using AJAX to make the update request. But that takes
a bit more code then you are showing. Depending on what version of
ColdFusion you have will determine what built AJAX functionality to
which you have access.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 10, 2008 Oct 10, 2008
LATEST
Thank you for the answer, Do you have any AJAX example or JavaScript Array?

I understand the concept and I am using CF 7 MX

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources