Hello,
I want use select2 box for input field mask selection and after selection user can edit this value.
Is this possible?
By sample input masks are:
Around “####”. year;
“##”. century
“##”. - "##. century
Hello,
I want use select2 box for input field mask selection and after selection user can edit this value.
Is this possible?
By sample input masks are:
Around “####”. year;
“##”. century
“##”. - "##. century
I’m not sure I understand what you mean by “input field mask selection”. I think you mean that you want to have a Select2 widget with the following options?
Around "####" year
"##" century
##".-"##". century
And then, when the user selects one of these options from the Select2 widget, you want to allow the user to edit the selected value by replacing the #
signs with digits. Is that correct?
If so, the selection part is simple–that’s just a regular Select2. But once that item is selected, it is not possible to edit the selected value in the text entry box that the Select2 provides. (Typing in that box would attempt to match an option in the Select2.) You would need to copy the selected option to a separate <input>
field and let the user edit it there.
Thank you. I found wonderful solution for this in component typeahead.js - https://twitter.github.io/typeahead.js/