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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:07:25+00:00 2026-05-30T10:07:25+00:00

I am using $(this).serialize() when submitting a form. It works well, except in times

  • 0

I am using $(this).serialize() when submitting a form.

It works well, except in times when I (for some reason) have 2 fields with same name (one visible, and one not, and I am not talking about type="visible" but display:none)…

But of course serialize has no regard for this… it just takes them all.

I tried this

var $disabled_list = $(this).find('input:hidden,select:hidden,textarea:hidden').attr('disabled', 'disabled');
$(this).serialize();
$disabled_list.attr('disabled','');

and It is solving my problem, except the :hidden selector, takes also type=”hidden”

what’s the proper way?

  • 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-30T10:07:26+00:00Added an answer on May 30, 2026 at 10:07 am

    You do not have to call serialize() on the <form> itself, you can match some of its controls and call it on the resulting set. This allows you to avoid tinkering with disabled attributes.

    Since you want controls matching :hidden only if they also actually expose the hidden type, you can use the following selector:

    $(this).find("input[type='hidden'], :input:not(:hidden)").serialize();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've already done a function using .serialize(). This is the function : $('form[name=contactForm]').submit(function(e){ e.preventDefault();
I'm submitting a form using a call to this JavaScript function: function emailFriend(){ jQuery(form[name='comparisons']).attr(action,
I'm using this jQuery Validation script to submit my form(s), but I need some
I have three forms and using this jquery function $('form').submit(function() { $.ajax({ type: $(this).attr('method'),
So I have a form and I'm submitting the form through ajax using jquery
I'm using this jquery to serialize my form and pass it to a PHP
i have large form in my website and using serialize() to process the form.
I'm using serialize() in this way: <script type=text/javascript src=jquery-1.4.2.min.js></script> <script type=text/javascript> $(document).ready(function(){ $(#form).submit(function(){ var
I'm using this right now: error_log(serialize(debug_backtrace())); But I have to unserialize it every time.
I am trying to serialize some Linq objects using this code. private byte[] GetSerializedObj(object

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.