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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:19:52+00:00 2026-05-19T03:19:52+00:00

I never found an optimal solution for this problem so I am hoping that

  • 0

I never found an optimal solution for this problem so I am hoping that some of you out there have a few solutions.

Let’s say I need to render out a list of checkboxes and each checkbox has a set of additional data that goes with it. This data will be used purely in the context of javascript and jquery. My usual strategy is to render this data in hidden fields that are grouped in the same container as the checkbox.

My rendered HTML will look something like this:

<div>
  <input type="checkbox" />
  <input type="hidden" class="genreId" />
  <input type="hidden" class="titleId" />
</div>

My only problem with this is that the data in the hidden fields get posted to the server when the form is submitted. For small amounts of data, this is fine. However, I frequently work with large datasets and a large amount of data is needlessly transferred.

UPDATE: Before submitting this post, I just saw that I can add a “DISABLED” attribute to my input element to suppress the submission of data. Is this pretty much the best approach that I can take?

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-19T03:19:53+00:00Added an answer on May 19, 2026 at 3:19 am

    If anyone else is reading this and is interested in a solution, you can use HTML5 custom data attributes. I know that HTML5 is still a working draft, but this concept seems to be approved. This allows me to strongly tie data to the element in question. In the case of my problem, I can now associate genreId and titleId directly to the checkbox instead of grouping hidden fields with the checkbox. Not exactly groundbreaking, but it’s nice to know that custom attributes are now part of the specification.

    Example:

    More info:
    http://dev.w3.org/html5/spec/Overview.html#custom-data-attribute

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

Sidebar

Related Questions

This is something I've pseudo-solved many times and have never quite found a solution
I've had this problem several times now, and never found a satisfactory solution: If
A problem I ran into a while back I never found a good solution
Never used a cache like this before. The problem is that I want to
For some reason I never see this done. Is there a reason why not?
I have used Fancybox on multiple occasions and never run into this problem. I
After lots of attempts and search I have never found a satisfactory way to
I have never really found the design view in Visual Studio useful when developing
I always have found the open source space interesting but have never actually participated
I have never found a neat(er) way of doing the following. Say I have

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.