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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:03:41+00:00 2026-05-25T20:03:41+00:00

I quite often do this: <input type=text id=whatever quantity=2 price=15 /> which causes VS2010

  • 0

I quite often do this:

<input type="text" id="whatever" quantity="2" price="15" />

which causes VS2010 to issue the above warning — I can live with the warnings because the inherent value in being able to hang data on form fields (which allows me later to pick them up for use in code e.g. $('#whatever').attr('price'), or simply document.getElementById('whatever').price) makes the nuisance warnings worth bearing. However, I was wondering what the canonical approach to this problem is…

anyone?

TIA – ekkis

  • 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-25T20:03:41+00:00Added an answer on May 25, 2026 at 8:03 pm

    If you’re using jQuery, you can store those variables in the object itself with .data():

    $('#whatever').data('quantity', 2);
    

    But I suggest splitting up your <input /> into multiple <input />s if you absolutely need to keep the information in the HTML file:

    <input type="hidden" id="whatever-quantity" value="2" />
    <input type="hidden" id="whatever-price" value="15" />
    

    But for complete HTML5 awesomeness, just prepend data- to your attributes:

    <input type="text" id="whatever" data-quantity="2" data-price="15" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run into this quite often where a new page is supposedly tested and
I have faced this problem quite often during the last couple of months, during
I've see this sort of thing in Java code quite often... try { fileStream.close();
This is my first time on StackOverflow though I read Coding Horror quite often.
Quite often, I find myself wanting a simple, dump object in Python which behaves
I ran into this quite often stated problem but even after looking up nearly
I find myself adding debugging print statements quite often -- stuff like this: print(a_variable_name:
Quite often I see source code where language's keyword are replaced with full type
Im a AS3 developer, currently learning Python In AS3 Id quite often do this:
Is there a way to cycle through open windows. I quite often use this

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.