The texbox is dynamically filled with a remote call using Select2 and I want to allow users to leave the field blank.
$("#e6").select2({
placeholder: "Search for a movie",
minimumInputLength: 1,
ajax: {
url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json",
dataType: 'jsonp',
data: function (term, page) {
return {
q: term, // search term
page_limit: 10,
};
},
results: function (data, page) {
return {results: data.movies};
}
},
});
Here is working example http://ivaynberg.github.io/select2/index.html#ajax