I am looking for a plug-in or way to duplicate the default combo box from visual studio in C#, where you can select from a list or type in a new value. I have found several plugins to "search" or act as an autocomplete for a select element, but I want the user to be able to see all options at any time through the drop down, and add their own through the text bar (or select an option then edit it, to either make a new option or permanently alter the selected option).
Does anyone know such a plugin?
I found this the other day, seems like it would meet your requirements: http://harvesthq.github.com/chosen/
(NOTE: I haven't used it yet so I can't comment on how well it works)
Related
I'm trying to use html5 datalist in my program (angularjs) because I want the user to have the possibility to enter an option which is not in the list.
However, what I have noted so far is, when using the html5 Datalist, you loose the possibility of choosing an item in the list by just writing part of the text and pressing tab. What happens is the input element retains just what you typed and not the complete item in the list.
Is there a way to make Datalist+Input to choose the whole item in the list by just typing part of it and pressing tab??
Many thanks for your help and bye ...
Well I just ended up using selectize.js in my project.
This is a jquery plugin that can use an (html) Input to allow the user to select an option from a list, but also permits the user to type a new option (which is not in the list). This is exactly what I wanted.
There is a great post about using the plugin in Medium:
Using Selectize.js to Make Your Forms Better
Many thanks and bye ...
So I am using select2 for tags on my site but I want it to work a bit differently than is does currently. I want an input field that you insert that tags into but i want the tags to be displayed below the input once selected. I have added an image of Linkedin as they currently do this:
I cant seem to find any options within select2 that allow for this (If this is available and i have missed it then i apologies) So I was wondering if anyone on here knows if this is possible using select2 and if not is there another plugin that i would be able to this with? Checking before i start to right this from scracth!
I use own library for functional testing in PHP, it's based on JsonWireProtocol.
I have an select element selected by id and I need to select 2 options from this element. I know how to select singe element - I just find desired option and click on it. But it's impossible with 2 options as second click deselects first one.
How can I achieve this?
As workaround I send a JavaScript line but I'm not happy with this solution.
From the JsonWireProtocol draft version I understand that Selenium interprets modifier-keys such as ctrl and shift as sticky. http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/keys and code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/keys
So I haven't tested this myself, but it seems to me that you can send a ctrl-keypress, follow by two clicks on the options you want to select, and then another ctrl-keypress to "depress" the ctrl-key.
I have a ListBoxFor and the first item is All Values. I already have the list box set to allow multiple selections. I would prefer to make it so that if a user selects the All Values option they are either asked if they want to clear out all other selections (Use All Values) or keep their current selections (De-select All Values). I would be ok without the user dialog asking them what to do and just automatically clearing out selections, but that is less preferable.
At first glance it seems that Javascript/jQuery is the best route to go about for this. I wanted to check to see if anyone knew of built in functionality for ListBoxFor that does this. The other option that I see is building a custom html extension. Even with this I still only see JS/jQuery being built and auto generated.
I want to create a drop down menu (like an <options> tag) in an HTML form. The issue is that I also want the user to be able to not only select from a list of options, but also type in their own if they want. So it would almost be like there was a text field that was automatically filled when you selected something from the drop down box, but you could still edit it.
This is the sort of thing I mean, only its a desktop app on windows (notice how the text can be edited):
I'm pretty flexible about exactly how it looks. If there is another, easy to implement, solution where the user can easy scroll/see a list of options or add in their own that doesn't look like what I described, I'm open to the idea.
Most of the drop down auto type scripts out there will let you type into the input box text that doesn't have to match one of the options in the options list. Just when you go to submit the form be sure to check to see if there is a selectedValue in the drop down and if not grab the drop down's text instead. How to do this will vary on what script you are using. As to what type ahead drop down script to use there are plenty out there, here is an ancient one that works pretty well but there are lot's of others.
http://trappedinhoth.blogspot.com/2008/07/jquery-autocomplete-example.html
HTML 5 even supports an autocomplete drop down
http://trappedinhoth.blogspot.com/2013/03/html-5-datalist-key-value-work-around.html
I hope that points you in the right direction.