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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:47:54+00:00 2026-05-20T04:47:54+00:00

I am using serialize() in an ajax() call. However, I only want to send

  • 0

I am using serialize() in an ajax() call. However, I only want to send some fields – more specifically, I don’t want to send the content field – as this contains a lot of verbose text – and is not needed.

I tried using $(‘#elem_id’).serialize()

but that returned an empty array (yes ‘elem_id’ is the id of an element in the DOM and it does exist).

Instead, I am using $(‘#form_id’).serialize(), which works but generates a ton of rubbish which I do not need..

Here is a sample string that is generated when I use serialize on the entire form:

rating%5Bvote_value%5D=3&blog_post%5Bcontent%5D=a-really-really-long-piece-of-text&blog_post%5Bid%5D=1

I want to implement a hack, to extract the string ‘blog_post%5Bcontent%5D=a-really-really-long-piece-of-text’ from the string obtained from the .serialize() method, so that I don’t eat up all my bandwidth.

Can anyone help with a JS function that will rip out ‘blog_post%5Bcontent%5D=a-really-really-long-piece-of-text’ and splice the string back together so that I can send the shortened string to the server?

Here is my attempt:

function delete_content_param(long_str){
  var pos1 = str.indexOf("&blog_post%5Bcontent%5D=");
  alert('pos1:'+ pos1);
  var pos2 = str.indexOf("&",pos1);
  alert('pos2:'+ pos2);
}

This did not yield the result I expected (i.e. index numbers), I thought I’d better come in here and ask the javascript Gurus, before wasting (yet another) entire afternoon

  • 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-20T04:47:54+00:00Added an answer on May 20, 2026 at 4:47 am

    You can filter out fields you wish to not serialize by using .not()

    $("#theForm :input").not("#text1").serialize();
    

    jsfiddle example.

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

Sidebar

Related Questions

I'm using the DataContractSerializer to serialize an objects properties and fields marked with DataMember
I'm trying to validate a form using an AJAX call to check available inventory.
I'm currently using jquery ajax to call a pagemethod (which works great); $.ajax({ type:
I am using JQuery ajax for authenticating username and password, however due to security
I want to make an ajax call from jQuery to my server. Basically, I
I'm using a plugin to do a non-Ajax post. However, my array is just
I am using an AJAX.Net to call an ASP.Net PageMethod, which returns JSON serialized
I have a codeigniter application.In that i call the controller function using ajax/jquery.But when
I'm using DataContractSerializer to serialize/deserialize my classes to/from XML. Everything works fine, but at
I'm using XmlSerializer to serialize my object model to XML. At the moment just

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.