Whatever message this page gives is out now! Go check it out!

ColdFusion.Ajax.submitForm

Last update:
May 18, 2026

Description

Submits form data without refreshing the page when the results are returned.

Function syntax

ColdFusion.Ajax.submitForm(formId, URL[, callbackhandler, errorHandler, httpMethod, asynch])

See also

cfajaxproxyColdFusion.navigateUsing the ColdFusion.Ajax.submitForm function in Using Ajax form controls and features in the Developing ColdFusion Applications

History

ColdFusion 8: Added this function.

Parameters

ParameterDescription
formId
The ID or name attribute of the form.
URL
The URL to which to submit the form.
callbackhandler
The JavaScript function to handle a normal response. The function must take a single argument, that contains the response body. This method is used only if the form submission is asynchronous.
errorHandler
The JavaScript function to handle an HTTP error response. The function must take two arguments: the HTTP status code, and the error message. This method is used only if the form submission is asynchronous.
httpMethod
The HTTP method to use for the submission, must be one of the following:
  • GET
  • POST (the default)
asynch
A Boolean value specifying whether to submit the form asynchronously. The default value is true.

Returns

If the asynch argument is false, returns the response body. Otherwise, the function does not return a value.

Usage

If the page that calls this function does not have any ColdFusion AJAX-based controls, use a cfajaximport tag on the page to ensure that the page includes the JavaScript definition for this function.
Note: This function does not submit the contents of file fields.

Example

See Using the ColdFusion.Ajax.submitForm function in Using Ajax form controls and features in the Developing ColdFusion Applications.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page