Displaying two dropdown menus with just a single coding component

Hey everyone, I'm having a problem with the dropdown list. I added an ASP dropdown list to a modal popup using a Bootstrap theme, but when the modal pops up, the dropdown list appears twice. Check out this image for reference: https://i.stack.imgur.com/VNBqf.png

Here is the HTML CODE:

<div class="col-sm-2">
    <div class="form-group form-group-sm">
        <div class="form-line">
            <asp:DropDownList ID="cboGender" runat="server">
                <asp:ListItem>M</asp:ListItem>
                <asp:ListItem>F</asp:ListItem>
                <asp:ListItem>Other</asp:ListItem>
            </asp:DropDownList>
        </div>
    </div>
</div>

And here is the code from the browser:

<div class="form-group form-group-sm">
  <div class="form-line">
    <div class="btn-group bootstrap-select">
      <button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown"
        data-id="MainContent_cboGender" title="Other">
        <span class="filter-option pull-left">Other</span>&nbsp;
        <span class="bs-caret">
          <span class="caret"></span>
        </span>
      </button>
      <div class="dropdown-menu open">
        <ul class="dropdown-menu inner" role="menu">
          <li data-original-index="0">
            <a tabindex="0" class="" style="" data-tokens="null">
              <span class="text">M</span>
              <span class="glyphicon glyphicon-ok check-mark"></span>
            </a></li>
          <li data-original-index="1" class="selected"><a tabindex="0" class="" style="" data-tokens="null"><span
                class="text">F</span><span class="glyphicon glyphicon-ok check-mark"></span></a></li>
          <li data-original-index="2"><a tabindex="0" class="" style="" data-tokens="null"><span
                class="text">Other</span><span class="glyphicon glyphicon-ok check-mark"></span></a></li>
        </ul>
      </div><select name="ctl00$MainContent$cboGender" id="MainContent_cboGender" class="" tabindex="-98">
        <option value="M">M</option>
        <option selected="selected" value="F">F</option>
        <option value="Other">Other</option>

      </select>
    </div>
  </div>
</div>

I'm in need of some assistance to fix this issue. Any help would be greatly appreciated!

Answer №1

The initial design was created with Bootstrap, but the alternative option seems to have been crafted differently.

<select name="ctl00$MainContent$cboGender" id="MainContent_cboGender" class="" tabindex="-98">
    <option value="M">M</option>
    <option selected="selected" value="F">F</option>
    <option value="Other">Other</option>

Answer №2

The issue was resolved by removing the import of bootstrap-select.js, which caused an extra button group to appear.

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

Is it feasible to utilize Sublime Editor for building SCSS/SASS files? Learn how to compile SCSS/SASS with Sublime Editor

Despite numerous attempts, I have been unable to figure out how to effectively use the Sublime Editor for creating scss/sass files. ...

Background positioning outside the container

Currently, I am in the process of constructing a website using wordpress. The theme has a predetermined width for all pages within a container. My goal is to confine the text within this container's width while extending the background of the <div& ...

Is jQuery failing to respond after being transferred from HTML to PHP?

The debug message from the Venkman debugger reads as follows: $("#aboutbox") is null [Break On This Error] $("#aboutbox").hide(); I'm at a loss on how to resolve this issue! It was functioning perfectly in HTML: But after transitioning it to PH ...

Restrict the amount of decimal places allowed in input text

Another question on Stack Overflow addresses limiting the number of characters allowed in a form input field. I am specifically looking to restrict the number of digits that can come after the decimal point to 2 digits. <input type="text" maxlength="2 ...

What could be causing my THREE.js Documentation Box to malfunction?

I am a newcomer trying to get the hang of THREE.js. I delved into the THREE.js Documentation and attempted to implement the code, but when I loaded my HTML page, it appeared blank. I am at a loss for what to do next. I utilized Visual Studio Code for codin ...

Transform [object HTMLDocument] to a String

Could someone guide me in converting the newHTMLDocument object into a full string including the doctype and html tag? let newHTMLDocument = document.implementation.createHTMLDocument(); let html = `<!DOCTYPE html> <html> <head> ...

Begin counting when a particular div element is visible on the screen

I have a plugins.init.js file that contains a try-catch block which runs on page load. I am looking for a way to execute this code only once when the div with the class counter-value comes into view. Is there a method to achieve this? try { const count ...

Equal vertical alignment in the center using flexbox

My flexbox layout is set up as shown in the code snippet below: html { height:100%; width:100%; } body { display:flex; flex-direction:column; align-items:stretch; height:100%; width:100%; margin:0; background-color:grey; } header { b ...

Is it possible to align a CSS table row with its corresponding table header even when the table row is deeply nested within the table structure?

I am looking to keep the structure of my HTML code consistent and unaltered. However, this has resulted in a form tag being nested inside a table row before the table cells can begin. The information I need to display is tabulated data, which makes CSS t ...

Identify the moment when the SPAN element reappears in sight

I have a question that may have been asked before, but I haven't found a satisfactory answer yet. Within my HTML code, I have a SPAN element with an onclick event, like so: <span onclick='loadDiv()'>Text</span> When a user cli ...

Executing Javascript to populate a div element with content based on its CSS class

Is there a way to isolate my View (HTML & CSS files) within a controller like JavascriptCode/AJAX, so that upon page load, only the controller binds the data to a specific element such as a DIV based on its class? Do you think this is achievable? If so, ...

Exploring the power of Django Haystack search within your HTML pages

Just had a thought: is it possible to search directly in an HTML file, ignoring the tags if desired? I couldn't find a quick answer on Google. To explain further, we have a crawler that returns the HTML of a page. If I want to search the content of t ...

Tips on personalizing buttons within Telerik form or Kendo form

Having recently started working with Telerik UI, I am struggling to customize a Kendo form in ASP.NET Razor Pages. Specifically, I am trying to rename a button but cannot locate the button field within the code. Despite following the guidelines provided in ...

Is there a way to send all the results of a Flask database query to a template in a way that jQuery can also access

I am currently exploring how to retrieve all data passed to a template from a jQuery function by accessing Flask's DB query. I have a database table with customer names and phone numbers, which I pass to the template using Flask's view method "db ...

Mobile responsiveness malfunctioning

I recently launched my first responsive design website, which you can view here After testing the responsiveness on Chrome and FF by resizing the window, everything seemed to be working fine. However, when I checked it on my phone, the layout appeared ide ...

Adjusting div height as you scroll down the page

Hello, I am new to CSS and I have encountered an issue with setting the height of a div element to 100%. When the list on my page exceeds the size of the page, the div is no longer visible when scrolling. Do you have any ideas on how to fix this? Here is t ...

Utilize various addMethods on a field in the event a radio button is chosen through the jQuery validator plugin

When a specific radio button value is selected, I need to apply different methods to a single field. If "true" is selected, method X should be applied. If "false" is selected, method Y should be used on the same field. I attempted to achieve this with a ...

Guide to incorporating a scroll-follow effect in multiple directions

I am facing a challenge with managing an array of divs that exceed the dimensions of their container. I have set overflow to hidden on the container and used JQuery Overscroll to achieve an iPhone-like scrolling effect on the map. The problem I'm try ...

Utilize an npm package to transform a CSS file into inline styles within an HTML document

I have an HTML file with an external CSS file and I would like to inline the styles from the external style sheet into one inline <style> tag at the top of the head. Any assistance would be greatly appreciated. Note: I do not want to use the style a ...

Press and hold feature using CSS or JavaScript

When working with a jQuery draggable element, my objective is to change the cursor to a move cursor when clicking and holding the header. I have attempted using CSS active and focus properties, but so far no changes are taking place. ...