Need to create select2 drop-down when click on text box - jquery-select2

i have a requirement that when i click on input type text box then select2 drop-down will automatically upon textbox and another text box will be automatically created down the select2 drop-down.

Maybe below link useful for you example
$(document).ready(function() {
$(".js-example-basic-single").select2();
});
Also visit url for see all examples select 2 examples

Related

Adding multiple dropdown on clicking a link

I have a link which says "add another field". On clicking the link a dropdown should appear on top with let's say 5 custom fields as list in dropdown. Once user selects a field in that dropdown and clicks hyperlink another dropdown should appear below existing dropdown and with only 4 remaining fields as one is already selected.so how to start this?
https://tutorialslink.com/Articles/How-to-add-control-dynamically-in-Aspnet-MVC-using-Javascript/64 . I have tried to use this link which adds text boxes to get started.
I don't have any code expect for the code in above link which is for text box though. Just need an idea of how to do it in asp.net MvC as i cannot move forward now.
Expected results is to do the above requirement, don't have any actual results as of now

JQuery select2 multiple options to be selected via jquery

I have a select2 box with multiple property in rails i want to add an option in a to this box with a selected state when i call a particular javascript. How do I achieve this?
function handleAddSoftwareVersion(button){
$("#device_versions").append($('<option>', {
value:1,
text: 'MyOption'
}));
}
How do i add that selected property to the select box. I can get the select2 to show the value as an option but how do i make it selected?

JQuery UI Autocomplete, not selecting a value on enter if mouseover

I have a problem with JQuery UI Autocomplete.
I want it to behave like this:
If I have positioned my mouse right under the input and entering values, so the autocomplete appears and press enter, the script will select the value from the autocomplete list. I'd rather want the script to just close and select the user entered value.
In short form: I want autocomplete just to replace the input text if a user actually clicks on a suggestion.
Is this possible somehow?
Best Regards
You can play with the select event:
select : function(event, selectedObject) {
jQuery(this).val(selectedObject.item.value);
}

How to create Combobox with multiselect capability?

How to create a Combobox having Multiselect Capability using Jquery?
Does JQuery Combobox has this functionality or Property?
if it helps, take a look http://ivaynberg.github.io/select2/ for multi select values
Edited : I found one more link it's really great http://tameraydin.github.io/jquery-easyselect/
Combobox displays the selected value when its list of options is collapsed. You may want to use multiple selection list.
to use multiple select in combobox you will have to create your own user control using checked listbox, textbox and a button.
and on click of button just make checked list box visible and let the user select items from that checkedListBox and as user select items on it you take those values and concatenate it in textbox with comma seperated. and then again on click on button hide that list box.
as it is on : http://9perhour.co.uk/
which is asking for select technology
some good samples
for jquery:
http://abeautifulsite.net/blog/2008/04/jquery-multiselect/
http://quasipartikel.at/multiselect/
http://www.codeproject.com/KB/ajax/jqueryajax.aspx
for asp.net:
http://www.codeproject.com/KB/user-controls/MultipleSelectionDropDown.aspx
http://www.codeproject.com/KB/webforms/DataGridDropDownList.aspx
http://www.codeproject.com/KB/asp/multiselectdropdown.aspx

tinymce text area onclick event change check box value

i am using tinymce editor for my form.
i have three instance of tiny mce editor for three text area.
on click a particular textarea i want to select a check box option .
first time i am using tinymce editor .
how can i select check for onclick of textarea.
The TinyMCE object exposes an onClick member you can bind a function to as follows:
//ed as your tiny-mce variable
ed.onClick.add(function(){
//Toggle checkbox here
});
You need to place this code into your plugins init-function. It adds an onclick handler:
// ed is the editor instance
ed.onNodeChange.add(function(ed){
// here you need to run the code to activate your checkbox
});

Resources