Html select form with option to enter custom value

Html select form with option to enter custom value

By: Voices Date of post: 13.06.2017

See this as a working sample using jQuery here: By using data attributes from HTML5 you can add extra data to elements in a syntactically-valid manner that is also easily accessible from jQuery.

By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users.

Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up.

html select form with option to enter custom value

Join the Stack Overflow Community. Stack Overflow is a community of 7. Join them; it only takes a minute: Adding additional data to select options using jQuery Ask Question. Very simple question I hope.

HTML select form with option to enter custom value - Stack Overflow

Phrogz k 61 Your question is not clear to me, anyhow. What do you mean by "store another value in the select options"?

Apache Tomcat/ (Ubuntu) - Error report

Do you mean you want to add a new option to the select, that would appear to the user when opened? If you find any of these answers useful, you should vote them up. You should also mark one as "accepted" if you found that it best solved your problem.

It will work in all browsers that html select form with option to enter custom value HTML5 data attributes. HTML5 "data" attributes are just custom attributes with a naming scheme html select form with option to enter custom value a best usd to gbp exchange rate london standard that declares them to be legal.

Clean energy stock options I know this. It's not a matter of browsers "supporting" invalid attributes, but rather a matter of ignoring them. There is really no other way to write a usable web browser: However I think it's a stretch to call data attributes "syntactically valid" - it depends on your context. If you have an HTML5 doctype, then yes, they're valid.

Otherwise they're not and will cause W3C validation to fail. I made two examples from what I think your question might be: It uses data attributes to store the other value: To me, it sounds like you want to create a new attribute? Well, it wouldn't be syntactically valid to have non-standard attributes in the original markup, but a I've never seen any browser since the days of NS4 have any problem with this, and b if you can modify the DOM to produce something that is "syntactically invalid", is it really?

Toby Allen 8, 7 54 Fadid 4 7. Please use the editor to format your code properly.

ACF | Select

To store another value in select options: Kyle 6 14 Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3.

Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

inserted by FC2 system