jquery-select2 (not working)
Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
-
JanMolendijk
- Posts: 242
- Location: Holland Rotterdam
jquery-select2 (not working)
Dear admin I`m testing this script on my server
https://coursesweb.net/jquery/selec2_jp , but it does not work.
I simply did copy your code for a test on my XAMPP Version: 5.6.31
Code: Select all
<link href="css/select2.min.css" rel="stylesheet" />
<script src="js/select2.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<select style="width:280px;" class="multi_sel" multiple="multiple" name="sel2">
<option value="v1">Alabama</option>
<option value="v2">Alaska</option>
<option value="v3">California</option>
<option value="v4">Nevada</option>
<option value="v5">New Mexico</option>
<option value="v6">Oklahoma</option>
<option value="v7">Oregon</option>
<option value="v8">Washingon</option>
</select>
<script>
$('.multi_sel').select2({
placeholder: 'Select a state',
maximumSelectionLength: 3
});
</script>
I hope you have some idea`s for me what i could do wrong ?
Admin
Hello,
When you use jquery plugins, you have to add the jquery library before the JS script with the plugin.
So, "js/jquery.js" before "select2.min.js".
Code: Select all
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/select2.min.js"></script>
JanMolendijk
Thank you for the support Admin,
i thought their was a problem with
the PHP-version or something else
It is working fine now (stupido me)
Similar Topics
-
Link to part of another page (not working)
PHP - MySQL
First post
I`m searching for few hours now but can`t find a solution to link to a part off a page ??? I try to use this...
In one comment-page I have this...
Last post
It is strange I tried alot things nothing working correctly.
Meight my Question is wrong, Because I try from a page a link to another page but the...
-
The disable attribute in option tag not working
HTML - CSS
First post
I have designed a html page, but in option tag I have set disabled= true , still it is not disabling the option.
Things I have tried:
disabled=...
Last post
The attribute disabled sets without value (without ='true' ). You need just add this attribute into the options you want disabled.
<option...
-
Get name in fbautocomplete jquery plugin
JavaScript - jQuery - Ajax
First post
I`m almost their with my tag-system
But my second question for today: I can`t find-out how to detect the names from this javascript.
I can detect...
Last post
Yes, in that function.
Then, see in browser console (F12) what data is displayed.
-
Adding jquery script to two buttons
JavaScript - jQuery - Ajax
First post
Dear admin I try to add two buttons in one off your scripts for opening via button
but i cant find out what i`m doing wrong one is opening but...
Last post
Hello,
There is no attribute id_1 . You can change the value of an atribute, but not its name.
You can use the same js script for multiple buttons;...
-
Execution order with jQuery-AJAX
JavaScript - jQuery - Ajax
First post
I have this code (ajax is async):
function echoHello(){
return $.ajax({
//this will return hello ;
});
}
function echoWorld(){
return world...
Last post
Ajax makes a call to the web server and is asynchronous. You don't know how long it will take. It is the same as:
setTimeout(_ => {...