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

  • Home
  • SEARCH
  • 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 4001320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:53:24+00:00 2026-05-20T07:53:24+00:00

I am trying to submit my form in AJAX, so I have to serialize()

  • 0

I am trying to submit my form in AJAX, so I have to serialize() the data. But I am using fckEditor and jQuery doesn’t know how to deal with it, so after the serialization, I am trying to manually modify the value, but no luck so far… any ideas

if(content_val!=""){
    var values = $("#frmblog").serialize();
    values.content = content_val; //content_val is the manually fetched data which I am trying to insert into the serialized content.
    alert(content_val); alert(values);
}
  • 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-20T07:53:24+00:00Added an answer on May 20, 2026 at 7:53 am

    serialize returns a URL-encoded string containing the form fields. If you need to append to it, you do so using the standard URL-encoded string rules, e.g.:

    var values = $("#frmblog").serialize();
    values += "&content=" + encodeURIComponent(content_val);
    

    (The above assumes there will always be one value in values after the serialize call; if that’s not necessarily true, determine whether to use & based on whether values is empty before you add to it.)

    Alternately, if you like, you can use serializeArray and then add to the array and use jQuery.param to turn the result into a query string, but that seems a long way ’round:

    // You can also do this, but it seems a long way 'round
    var values = $("#frmblog").serializeArray();
    values.push({
        name: "content",
        value: content_val
    });
    values = jQuery.param(values);
    

    Update: In a comment added later you said:

    The problem is, there is some default values being set in the ‘content’ key during the serilization process, so I can’t just attach a new value, I have to update the one already in it”

    That changes things. It’s a pain to look for content within the URL-encoded string, so I’d go with the array:

    var values, index;
    
    // Get the parameters as an array
    values = $("#frmblog").serializeArray();
    
    // Find and replace `content` if there
    for (index = 0; index < values.length; ++index) {
        if (values[index].name == "content") {
            values[index].value = content_val;
            break;
        }
    }
    
    // Add it if it wasn't there
    if (index >= values.length) {
        values.push({
            name: "content",
            value: content_val
        });
    }
    
    // Convert to URL-encoded string
    values = jQuery.param(values);
    

    You’d probably want to make this a reusable function.

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

Sidebar

Related Questions

i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I'm trying to submit a form with AJAX using jquery: <form name=myform action=> <table
I am trying to submit a form using Ajax.Updater and have the result of
I am trying to submit a form after validating captcha using an ajax request
I'm trying to submit a Rails form with AJAX. I have some toggle on/off
I'm trying to submit a form when a select changes using jQuery Mobile. I
Hi i was im trying to make a jquery ajax submit form, and im
I am trying to have an Ajax form submit when the value within a
I'm trying to get a nested form to submit via AJAX, but I can't
I have a form I'd like to submit as JSON via jQuery AJAX, so

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.