Hey all this is the first time I've ran into this problem with javascript/jquery. Below I have a part of code that I am trying to place an IF/Than else statement in order order to decide what type of class I need to place into the DIV it creates:
Select3.Templates = {
dropdown: function (options) {
var extraClass = (options.dropdownCssClass ? ' ' + options.dropdownCssClass : ''),
searchInput = '';
if (options.showSearchInput) {
extraClass += ' has-search-input';
var placeholder = options.searchInputPlaceholder;
searchInput = (
'<div class="select3-search-input-container">' +
'<input class="select3-search-input"' + (placeholder ? ' placeholder="' + escape placeholder) + '"'
: '') + '>' +
'</div>'
);
}
return (
'<div class="select3-dropdown' + extraClass + '">' + searchInput + '<div class="select3-results-container"></div>' +
'</div>'
);
},
loading: function () {
return '<div class="select3-loading">' + Select3.Locale.loading + '</div>';
},
loadMore: function () {
return '<div class="select3-load-more">' + Select3.Locale.loadMore + '</div>';
},
multipleSelectInput: (
'<div class="select3-multiple-input-container">' +
'<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" class="select3-multiple-input">' +
'<span class="select3-multiple-input select3-width-detector"></span><div class="clearfix"></div>' +
'</div>'
),
[ect...ect..]
I'm trying to insert my if than else statement into the multipleSelectInput area but I am unsure how to go about doing that since it seems to be some type of array (or object array) or something I don't know what it's called :)?
If I place my if than else statement above the if (options.showSearchInput) { will that work within the multipleSelectInput area?
What I need to changed within the multipleSelectInput is:
'<div class="select3-multiple-input-container">' +
to
'<div class="select3-multiple-input-containerADMIN">' +
depending on the if statement else path.
So how can I insert the if than else statement where I need to?