Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:29:18+00:00 2026-05-23T21:29:18+00:00

Currently working on trying to figure out asynchronous submission in ColdFusion. I always have

  • 0

Currently working on trying to figure out asynchronous submission in ColdFusion. I always have trouble with this. I have a form that I want to submit to a remote CFC and get some sort of response back. (Eventually this form is going to have a draft like function…) I know how to set up each part: the form and the CFC. My problem is connecting them!!! There was some similar post about this, but none offer sufficient information….for me at least.

Form:

<cfform action = "/cfc/request.cfc?method=updateRequest"  method = "post" name = "requestForm" id = "requestForm" enctype="multipart/form-data">
    ........<!-- Fields redacted -->

</cfform>

CFC Method (this was just a test):

<cffunction name="updateRequest" access="remote" returntype="numeric">
        <cfargument name="form" type="struct" required="yes">
        <cfset var status = 0>

         <cfreturn status>
</cffunction>

Note: my CFC function is set to remote etc. etc. etc…

I have my form here which should post to the cfc, however it actually goes to the cfc page. I don’t want this. I’ve grown so frustrated with trying to use ajax with ColdFusion. I’m ready to resort to just using jQuery to submit it. I can do it jQuery…however I don’t know how to get the fields into a struct. (This form is going to be large…) I’d like to see how to send form information as a struct in either ColdFusion or jQuery. I want to be able to retain the form field names.

Even if someone could point me in the right direction…that would be great. I’ve tried to find a GOOD tutorial on this for sometime and have not been able too.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:29:19+00:00Added an answer on May 23, 2026 at 9:29 pm

    If you want to pass the form controls as a structure, I would first try serializing the form elements as a json string, then pass that string to your webservice. From your webservice, you could then use DeserializeJSON() to convert it back to a structure. Here’s some code that should get you close to this:

    <script>
    /* function prototype code modified from here: http://api.jquery.com/serializeArray/#comment-130159436 */
    (function( $ ){
    $.fn.serializeJSON=function() {
    var json = [];
    jQuery.map($(this).serializeArray(), function(n, i){
    json.push('"' + escape(n['name']) + '":"' + escape(n['value']) + '"');
    });
    return '{' + json.join(',') + '}';
    };
    })( jQuery );
    
    // make the request to your webservice
    $.post('myComponent.cfc?method=updateRequest', { formJSON: $("#requestForm").serializeJSON()}, function () { /* handle response here. */ })
    </script>
    

    Then in your CFC, change the argument like so:

    <cffunction name="updateRequest" access="remote" returntype="numeric">
        <cfargument name="formJSON" type="string" required="yes">
        <cfset var formStruct = DeserializeJSON(arguments.formJSON)>
        <cfset var status = 0>
    
         <cfreturn status>
    </cffunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out the cleanest way to do this. Currently I have
I am currently trying to figure out a way to have an Android application
I'm currently beating my head against a wall trying to figure this out. But
I'm currently trying to figure out how to output my HTML form data to
I have been trying to figure this one out but I am having a
I am trying to get MSTest working with CruiseControl.Net. I currently have it working
I am trying to figure out the right workflow for this situation: On the
I'm currently working on a problem that involves System.Reflection.Emit code generation. I'm trying to
I apologize if this question is slightly subjective... I am trying to figure out
I'm currently trying to figure out the best way to implement doctrine persisted Role

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.