Skip to main content
Known Participant
May 14, 2009
Question

(CF8) cfform ajax postback

  • May 14, 2009
  • 1 reply
  • 1628 views

I'm trying to create a simple ajax postback using a cfform and coldfusion 8.

<cfform>

<cfinput type="radio" name="val" value="1">
<cfinput type="radio" name="val" value="2">
<cfinput type="radio" name="val" value="3">
</cfform>

<cfoutput>#form.val#</cfoutput>

When a radio button is selected I want it to update the value without refreshing the page.

What is the best way to do this?

This topic has been closed for replies.

1 reply

ilssac
Inspiring
May 14, 2009

AJAX functionality will allow you to do that.

The documentation will tell you how to get started with the ColdFusion features that help you create AJAX functionality.

There are other frameworks that help with this as well such as JQuery.  Their documentation will describe how to use their tools.

Or you can roll your own.

Sam_HamAuthor
Known Participant
May 14, 2009

Hi Ian,

I want to perform this with coldfusion. Unfortunately the coldfusion support centre is not very helpful for people looking to learn the new features. All the documentation is on basic html pages with no links to real life examples.

I have tried this method.

<cfdiv>

<cfinput type="radio" name="val" value="1" onClick="submit()">
<cfinput type="radio" name="val" value="2" onClick="submit()">
<cfinput type="radio" name="val" value="3" onClick="submit()">
</cfform

<cfoutput>#form.val#</cfoutput>

<cfdiv>

This works, however the  onClick="submit()" refreshes the page which is not what i need.