flashing issue with bootstrap selectpicker

Can you rearrange the jQuery code and incorporate popper.js into bootstrap 4?

$('.selectpicker').selectpicker();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/js/bootstrap-select.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/css/bootstrap-select.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>

<select class="selectpicker" name = "usertype"   title="User Type"  required="true" data-size="7">
            <option value="0"> test1 </option>
            <option value="2"> test2 </option>
            <option value="4"> test3 r</option>
            <option value="6"> test4 </option>
</select>
 <input name = "first_name"  type="text" placeholder="Name" class="form-control"  required="true" value = "">

 <input name = "last_name"  type="text" placeholder="Name" class="form-control"  required="true" value = "">

Answer №1

Reorganize the jQuery code and incorporate popper.js along with bootstrap 4

$('.selectpicker').selectpicker();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/js/bootstrap-select.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/css/bootstrap-select.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>

<select class="selectpicker" name = "usertype"   title="User Type"  required="true" data-size="7">
            <option value="0"> test1 </option>
            <option value="2"> test2 </option>
            <option value="4"> test3 r</option>
            <option value="6"> test4 </option>
</select>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Jquery to implement autocomplete functionality by iterating over each item with the .each

I have been attempting to implement autocomplete using the .each() function. I am referring to the documentation on http://jqueryui.com/autocomplete/. You can view my attempt in this FIDDLE link where it is currently not functioning as expected. The scen ...

How to iterate and apply styles to properties of objects in an array using Vue.js?

Currently, I am working with Vue.JS and facing some challenges while outputting data using the v-for loop. My objective is to repeat a 'base' item with unique information. You can refer to the image below for better understanding. https://i.ssta ...

Exploring deep nested components and elements in Angular for a targeted specific functionality

Is it possible to apply the ng deep css class to only one specific checkbox in my component, rather than all checkboxes? I want to customize just one checkbox and leave the others unchanged. How can this be achieved? Thank you. I need the CSS modificatio ...

"Automatically scroll back to the top of the page once new content

Is there a way to automatically scroll the page to the top after content has been loaded via Ajax? Here is the code I am using to display the content: $(document).ready(function () { var my_layout = $('#container').layout(); $("a.item_l ...

What are the consequences of submitting a form to a different website through POST method?

Dealing with a CMS that does not offer an easy way to add a NodeJS route for handling form data can be quite challenging. I'm considering the following setup - would this be considered bad practice or unsafe? Server 1 (Ghost CMS) : www.domain.com &l ...

Does creating a form render the "action" attribute insignificant in an AJAX environment?

When submitting forms exclusively through AJAX, is there any advantage to setting the action attribute at all? I have yet to come across any AJAX-form guides suggesting that it can be left out, but I fail to see the purpose of including it, so I wanted t ...

Bootstrap Modal - Preselected Dropdown Option

When using Bootstrap Modal, I am encountering an issue where the default option is not being displayed correctly. Instead of "Please Select" appearing as the default choice in the drop-down, it is showing up as "A" by default. Below is the HTML code snip ...

Tips on incorporating Angular ng-include

As a newcomer to AngularJS on an Express Framework, I am facing an issue with loading HTML pages as includes. Although my routing in Angular is set up correctly and functioning well, when I try to use ng-include in my HTML pages, it results in a loop and t ...

What is the best way to configure a CakePHP method to generate standard HTML output when the controller is set to default JSON?

Currently, I am working on developing an Android application and utilizing CakePHP on the server side. I have a UsersController that provides JSON data for functionalities like login, registration, etc, except for account activation. As account activatio ...

Activate HTML event upon reaching a specific point while scrolling, and then reactivate by scrolling back

I'm encountering an issue where the fade effect triggers when I scroll past a certain point, but then fails to fade back in once I scroll back. Is my approach correct or am I missing something? Currently, it fades out abruptly at a specific point and ...

md-datepicker incorrect input- AngularJS

When selecting a non-existent date manually in the input, the calendar shows the date I expect but the input does not. Here is the code snippet: <md-datepicker name="startDate" class="custom-datepicker" ng-model="models.startDate" md-placeholder="Ente ...

The jquery click event is not working as expected

Hey there, I've been working on creating a dropdown menu that can be activated by clicking for better usability on touch screens. $('a.dropsmall2').click(function() { $(this).next('ul').slideToggle(500,'easeInOutQuad'); ...

Troubleshooting the issue of Ajax form submission not working as expected without page refresh

I am attempting to submit the form on the same page without refreshing the page. Here is my form: <?php if(isset($_POST['transfer'])){ $amount = $_POST['amount'] ? $_POST['amount'] : ''; $from_c = $_POST[ ...

Instructions for applying a border style to a dynamically generated table using jQuery

I'm currently working on adding CSS to a table that is generated dynamically when a button is clicked. The function that is triggered on the click event includes the following jQuery code to create the dynamic rows: $("#employeDetail").append('& ...

Can you explain the distinction between using a period in a class selector and not using one?

Could someone please clarify the meaning of the code snippet below? <div class="cls1 cls2">abcd <div class="cls2"> adfffff </div> </div> .cls1 { background-color: yellow; } /*sample1 .cls1.cls2 { color: red; } */ /* ...

Changing the Size of an Image using HTML and CSS

Does anyone know how to resize images using CSS in an external style sheet instead of directly in the HTML document? I've tried searching on W3Schools but haven't been able to find a solution. I want to maintain consistent styling by resizing im ...

Creating button text wrapping with Bootstrap 5

My goal is to design a button using Bootstrap 5 that has a unique appearance. I came across a similar post on Stack Overflow but couldn't find a solution that fits my needs. This is the HTML code I attempted: <button type="button" class="btn ...

Enhance Your Charts: Learn how to dynamically adjust zoom levels between two timestamps with just a simple form submission

I have a Zingchart Area Graph that displays events on a timeline with time on the X-Axis. I want to be able to automatically zoom into a specific timeframe on the graph based on user input from a form. For example, if a user selects a start time of 8 AM an ...

AngularJS templateUrl changes on page refresh``

I am currently using an angular packet template that consists of 11 pages, each with a corresponding button. The route code for this template is as follows: state('app.pagelayouts.fixedsidebar1', { url: "/fixed-sidebar", templateUrl: "assets ...

Can you provide step-by-step instructions on how to customize styles with MUI in my application?

I am encountering issues with MUI while attempting to customize the color of my buttons. The two methods I have tried so far have been unsuccessful. For example, Method 1: import React from 'react' import { Typography } from '@mui/material& ...