VikramShetty_73bit Posted October 22, 2019 Share Posted October 22, 2019 I have implemented a bootstrap multiselect dropdown and there are some weird code added at the bottom of the list as displayed in the screenshot below. You can look at a screen grab of the same attached. The drop down loads rest of the values correctly but adds up this code in the end. The html of the drop looks like this <div class="dropdown bootstrap-select show-tick chart"> <select multiple="" class="selectpicker chart" index="0" chart_name="Overall_Score" tabindex="-98"> <option value="Good Value" selected="">Good text</option> <option value="Good Value2" selected="">Good text2</option> <option value="function(e,t){return this.splice(e,!t||1+t-e+(!(t<0^0<=e)&&(t<0||-1)*this.length)),this.length}" selected="">function(e,t){return this.splice(e,!t||1+t-e+(!(t<0^0<=e)&&(t<0||-1)*this.length)),this.length}</option> <option value="function(e){this.removeRange(e,e)}" selected="">function(e){this.removeRange(e,e)}</option> <option value="function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return void this.removeAt(t)}" selected="">function(e){for(var t=0;t</option> <option value="function(){for(var e=[];this.length;)e.push(this.splice(Math.random()*this.length,1));for(;e.length;)this.push(e.pop()[0]);return this}" selected="">function(){for(var e=[];this.length;)e.push(this.splice(Math.random()*this.length,1));for(;e.length;)this.push(e.pop()[0]);return this}</option> <option value="function(e){return-1<this.indexOf(e)}" selected="">function(e){return-1</option> </select> </div> If anyone know how to fix this issue please let me know. Link to comment
SnazzyView Posted October 22, 2019 Share Posted October 22, 2019 I can definitely see the problem with the HTML code but I'm not really too sure what you're trying to achieve. Would you be able to provide some more context or a link to your website or an example of what you're trying to achieve? Link to comment
brandon Posted October 22, 2019 Share Posted October 22, 2019 Agreed. More context would help. In general though, inserting JavaScript code in the "value" attribute will simply result in the code you write being shown as the option. What you're seeing is just that: the lines of JavaScript you've inserted in each "value" attribute listed as options in the select element. If a response helped you out, send a 'Like' 👍 (bottom-right) and/or 'Upvote' (top-left) Link to comment
VikramShetty_73bit Posted October 23, 2019 Author Share Posted October 23, 2019 13 hours ago, VikramShetty_73bit said: I have implemented a bootstrap multiselect dropdown and there are some weird code added at the bottom of the list as displayed in the screenshot below. You can look at a screen grab of the same attached. The drop down loads rest of the values correctly but adds up this code in the end. The html of the drop looks like this <div class="dropdown bootstrap-select show-tick chart"> <select multiple="" class="selectpicker chart" index="0" chart_name="Overall_Score" tabindex="-98"> <option value="Good Value" selected="">Good text</option> <option value="Good Value2" selected="">Good text2</option> <option value="function(e,t){return this.splice(e,!t||1+t-e+(!(t<0^0<=e)&&(t<0||-1)*this.length)),this.length}" selected="">function(e,t){return this.splice(e,!t||1+t-e+(!(t<0^0<=e)&&(t<0||-1)*this.length)),this.length}</option> <option value="function(e){this.removeRange(e,e)}" selected="">function(e){this.removeRange(e,e)}</option> <option value="function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return void this.removeAt(t)}" selected="">function(e){for(var t=0;t</option> <option value="function(){for(var e=[];this.length;)e.push(this.splice(Math.random()*this.length,1));for(;e.length;)this.push(e.pop()[0]);return this}" selected="">function(){for(var e=[];this.length;)e.push(this.splice(Math.random()*this.length,1));for(;e.length;)this.push(e.pop()[0]);return this}</option> <option value="function(e){return-1<this.indexOf(e)}" selected="">function(e){return-1</option> </select> </div> If anyone know how to fix this issue please let me know. I am sorry that the question wasn't clear. We think we have found the issue. It is somehow added in our custom code. We are investigating it further. So squarespace could not be an issue Thank you for your help. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.