I need to count teacher_id selected.
my input:
<select class="js-example-basic-multiple" name="teacher_school_id[]" id="teacher_school_id" multiple="multiple" style="width: 100%;">
<?php foreach($teachers as $teacher){
?>
<option value="<?php echo $teacher->teacher_id; ?>"><?php echo $teacher->teacher_name; ?></option><?php } ?></select>
div:
<div id="test">Here i need how many teachers are selected</div>
script for counting teachers:
$(document).ready(function () {
$('#test').html('How many teachers?: ' +0 + ' entries');
$('.js-example-basic-multiple').change(function () {
var count = 0;
$('.js-example-basic-multiple').each(function () {
if($.trim($(this).val()).length > 0)
count++;
});
$('#test').html('How many teachers?: ' +count + ' entries');
})
script for multiple selection:
$(document).ready(function() {
$('.js-example-basic-multiple').select2();
But still doesnt work. No count. No output displayed. Any suggestion? Thanks a lot.
how to make req.query only accepts date format like yyyy-mm-dd
Start Application class A from different Application class B in same Android bundle
How can I get data for select box and set the data while using searching?
Is it possible to log the bytes which a server sends? [closed]
I want to display some items with a flatlist, when I tap on the item I want it to turn greenThe issue I having is that I tap on a couple of the item and then I search for a device, for example: 112
For webHey is there any possible to download url of files from firestore storage without providing the file name in the storage reference ? Like if we have to download and display all the images from a particular folder, is it must to know the names of all the files uploaded...
I set up a webpack configuration, that uses the MiniCssExtractPlugin to compile my css into a single file into my public folder
I am trying to return two values in JavaScriptIs that possible?