Solved

Select Options, more data

Posted on 2015-02-11
2
56 Views
Last Modified: 2015-02-11
Is there a way to add additional information to a select options ?
<select>
<option name="option_one" id="option_one" ADDTIONAL DATA="additional_data_one" ADDTIONAL DATA="additional_data_two">OPTION ONE</option>

<option name="option_two" id="option_two" ADDTIONAL DATA="additional_data_one" ADDTIONAL DATA="additional_data_two">OPTION TWO</option>
</select>
0
Comment
Question by:rgranlund
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
Comment Utility
Of course. Use the data- attribute.

Example:
<option name="option_one" id="option_one" data-whatever="additional_data_one" data-something="additional_data_two">OPTION ONE</option>

http://www.w3schools.com/tags/att_global_data.asp
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I'm not sure what the point of all that is since you have no 'value' in your options.  The 'value' is what gets submitted when you submit the form.
http://www.w3schools.com/html/html_form_elements.asp
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now