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 6978631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:46:54+00:00 2026-05-27T17:46:54+00:00

Reference is made to prior question here: How do I use jquery validate remote

  • 0

Reference is made to prior question here: How do I use jquery validate remote validation to set and return form field values to the form action page?

I am using JQuery Validate to perform remote form validation in our Coldfusion Application.

As remote validation errors are caught and prepared for user notification, we are building a return structure which contains not only the validation error, but a group of form fields for use in the form action page.

As the remote validation error structure is merged with our form structure, our validation display to the user is now breaking.

Here is a snippet of the error text being created:

<cfset form.errorfieldlist = listappend(form.errorfieldlist, "password")>
<cfset form.errormessagelist = listappend(form.errormessagelist, "Your <strong>assigned password</strong> is required to proceed.", form.rs)>

Here’s a snippet of the initial error structure being set:

<cfset result_struct = {
  errorfieldlist = listtoarray(form.errorfieldlist),
  errormessagelist = listtoarray(form.errormessagelist, form.RS)
}>

Here is where we append the form structure to the result structure:

<cfset StructAppend(result_struct, form)>

Here is the return back to the validation plugin:

<cfoutput>#serializeJSON(result_struct)#</cfoutput>

Here is the validation plugin formatting the error return for user display:

var errors = {};

$.each(data.ERRORFIELDLIST, function(i, val) {
  eval("errors."+val+"='"+data[i]+"'");
});

var dialog_html = '<ul>';

 $.each(data.ERRORMESSAGELIST, function(i, val) {
   dialog_html += '<li><span style="color:#cd0a0a;">'+val+'</span></li>';
 });

BEFORE we started merging the form structure with the result structure, our error reporting routine worked as expected. Here is a sample dump of the #serializeJSON(result_struct)# of that working return:

while(1);{"ERRORMESSAGELIST":["Please enter a valid <strong>password<\/strong> (hint: it's case sensitive).","Don't forget, if you need help at any time, please don't hesitate to <strong>click the 'Contact Support' button below<\/strong> for an immediate reponse. Thanks!"],"ERRORFIELDLIST":["password"]}

And here is what it looks like AFTER we started merging the structures:

while(1);{"ITEMTHUMB_TITLE":"","ERRORMESSAGELIST":"Please enter a valid <strong>password<\/strong> (hint: it's case sensitive).|Don't forget, if you need help at any time, please don't hesitate to <strong>click the 'Contact Support' button below<\/strong> for an immediate reponse. Thanks!","ITEMIMAGE_BORDER":"","CARTDOWNLOADKEY":"13FF45A0-E628-749F-C6BB79F60DF90E6F","ITEMURL_SIZE":"","ITEMNAME":"","FIELDNAMES":"VERIFIED,DLURL,DLLOCATION,ITEMNAME,ITEMTEASE,ITEMIMAGE,ITEMIMAGE_BORDER,ITEMIMAGE_ALT,ITEMIMAGE_TITLE,ITEMTHUMB,ITEMTHUMB_BORDER,ITEMTHUMB_ALT,ITEMTHUMB_TITLE,ITEMPUBNOTES,ITEMURL_SIZE,FIRST_NAME,EMAIL,PASSWORD,CARTDOWNLOADKEY,SUBMIT_BUTTON","ITEMIMAGE_ALT":"","DLLOCATION":"","ITEMTHUMB_BORDER":"","ITEMTEASE":"","RS":"|","ITEMIMAGE_TITLE":"","ITEMTHUMB_ALT":"","FIRST_NAME":"","ITEMPUBNOTES":"","EMAIL":"bmyers@bmyers.com","VERIFIED":"","ERRORFIELDLIST":"password","PASSWORD":"1asdf1","ITEMIMAGE":"","SUBMIT_BUTTON":"Get Download","DLURL":"","ITEMTHUMB":""}

So, in effect, the error modal that should look like this:

expected behavior

… instead looks like this:

unexpected behavior

Can you tell me what is causing this break to happen as a result of the structure merge?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 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-27T17:46:54+00:00Added an answer on May 27, 2026 at 5:46 pm

    I think the structAppend() is overwriting the values from result_struct. Try changing the call to this:

    <cfset StructAppend(result_struct, form, false)>
    

    The false here instructs CF to not overwrite the entries in struct1 with those that were found in struct2: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_s_15.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i have created Windows Form Application and made a library added a reference
I made a Dictionary <string, string> collection so that I can quickly reference the
In reference to this answer to a Stack Overflow question : what is bench-testing
Object reference not set to an instance of an object. using System; using System.Collections.Generic;
I'm testing the reference project that karl has made for silverlight. In it on
I removed an attribute from an object; I made sure there is no reference
I'm having a bunch of custom-made Reference Classes and would like to write coercion
This is a probably a dumb question but here is what I've got. A
My team member made a reference to a DLL on his local drive (e.g.,
I know that with the following, a reference is made public class MyClass {

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.