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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:18:38+00:00 2026-06-06T00:18:38+00:00

I am currently using id values in div tags to serialize , i.e: HTML:

  • 0

I am currently using id values in div tags to serialize, i.e:

HTML:

<div class="column">
    <div id="portlet_1">some content here</div>
    <div id="portlet_2">some content here</div>
    <div id="portlet_3">some content here</div>
</div>

jQuery:

$(this).sortable('serialize', {key: 'item'})

That works fine.

The problem is that I need to allow the user to dynamically choose which porlet s/he wants on screen where they can have the same portlet on the screen many times if they want, i.e:

HTML:

<div class="column">
    <div id="portlet_1">some content here</div>
    <div id="portlet_1">some content here</div>
    <div id="portlet_1">some content here</div>
    <div id="portlet_2">some content here</div>
    <div id="portlet_2">some content here</div>
    <div id="portlet_3">some content here</div>
</div>

This causes a lot of issues because of the identical ids.

Now that I have changed the structure to use classes instead of ids, i.e:

HTML:

<div class="column">
    <div class="portlet_1">some content here</div>
    <div class="portlet_1">some content here</div>
    <div class="portlet_1">some content here</div>
    <div class="portlet_2">some content here</div>
    <div class="portlet_2">some content here</div>
    <div class="portlet_3">some content here</div>
</div>

How do I serialize based on the class instead of the id?

Here is a more complete extract of the code which doesn’t working because it serializes based on ids:

jQuery:

$(".column").sortable({
    connectWith: '.column',
    update: function(event, ui) {
        var that = this;

        $.ajax({
            url: 'some web service here',
            type: 'POST',
            data: { strItems:$(that).sortable('serialize', {key: 'item'}) },
            error: function(xhr, status, error) {
                //some error message here
            },
            success: function() {
                //do something on success
            }
        });

    }
});

Sorry, forgot to mention that I am using an old jquery version 1.4.

  • 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-06-06T00:18:40+00:00Added an answer on June 6, 2026 at 12:18 am

    Try this :

    $(this).sortable('serialize', {key: 'item', attribute: 'class'});
    

    jQuery UI 1.8 documentation :

    The possible options are: ‘key’ (replaces part1[] with whatever you want), ‘attribute’ (test another attribute than ‘id’) and ‘expression’ (use your own regexp).

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

Sidebar

Related Questions

Currently I'm using this: HTML: <div id=container> <img src=x.jpg id=bg /> <div id=content> <h1>Welcome
I'm trying to set some content in between some div tags on a JSP
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
I'm currently using the validation code listed here in an application. I'd like to
I have my form elements here: <li><div id=formanswer1 class=clonedInput>Answer: <input type=text id=formanswer1 value= /></div></li>
I'm currently using the confirmaction jQuery plugin found here: http://www.webstuffshare.com/2010/03/jquery-plugin-jconfirmaction/ And my question is
I need to get the values of all checkboxes that are currently checked using
I am currently using Valums JQuery File Upload plugin. The plugin is very convenient
I'm currently using the TextBlock below to bind the value of a property named
I am currently using the following script to set this value as a String:

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.