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

ColdFusion, AJAX and Form Checkboxes

New Here ,
Jun 02, 2008 Jun 02, 2008

Copy link to clipboard

Copied

Greetings all...

I am new to AJAX, particularly as it pertains to CF. I've searched pretty extensively but I can't seem to find a solution or example of how to integrate AJAX with CF in a way that I can automatically pass an update to a table when a checkbox is clicked.

I understand from my searching that this functionality is made simple in CF8, however I am developing this in CF MX7, and upgrading is not a possibility right now. I hope someone has some knowledge, or even an example of this somewhere on the Interwebs that I can pick apart to learn from.

Basically, the details of what I want to do is: I output a list of items from a DB table into a list. The last column on this list contains a checkbox. When I click the checkbox next to an item, I want to update that record in the associated DB table...in this case I would be updating a row from 0 to 1 or back to zero again if the box is unchecked. I am also limiting the number of boxes checked to 5, but I've already figured out that logic using Javascript and it is working.

I suspect this is a very simple thing to do, however my unfamiliarity with AJAX is causing a huge problem. Thanks in advance for any help you can give or resources you can point me to. It is much appreciated.


David K.
TOPICS
Advanced techniques

Views

383

Translate

Translate

Report

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
Explorer ,
Jun 02, 2008 Jun 02, 2008

Copy link to clipboard

Copied

LATEST
This might not be the best way to get it done, but what I would do is have an invisible iFrame in the page. When the checkbox is clicked, use javascript to submit a form on the iFrame which will do the updating work.

If you opt for this solution, be aware that a possible problem could be when the user clicks the checkboxes faster than the iFrame can do the updating work. This will cause the iFrame to start a new update operation without finishing the first.

Votes

Translate

Translate

Report

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
Documentation