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

The span created by jQuery does not automatically focus on the lightbox image

I am currently working on a jQuery script that generates a lightbox span when the drop-down menu is changed. My objective is to display an image when the drop-down menu changes and allow users to click on the image to open the lightbox on the screen. The ...

Positioning the comments box on Facebook platform allows users to

Need assistance, I recently integrated the Facebook comments box into my Arabic website, but I am facing an issue where the position of the box keeps moving to the left. Here is an example of my website: Could someone please suggest a solution to fix the ...

Can you tell me the specific name of the HTML document style that features two columns?

Here are two websites that showcase a unique two-column style layout: http://momentjs.com/docs/ I find these sites visually appealing and I am curious about the specific name of this style. Is there a template or tool available to create documents with a ...

Creating visually appealing Jquery-ui tab designs

Trying to customize the jquery tabs, I experimented with styling them to my liking. One thing I did was attempt to reduce the size of the tabs by adding a height:45px; to the UI stylesheet shown below. .ui-tabs-vertical .ui-tabs-nav li { clear: left; ...

Utilizing CSS to create a repeating background image within a specified container

I'm currently working on setting up a container with a background image that repeats only when the contained div elements are long enough. However, I seem to be encountering issues getting the image to repeat properly within the #container code. This ...

Show or hide a div based on the visibility of another div in Angular using *ngIf

Looking for a way to dynamically display images based on the visibility of another image? Consider the code snippet below: <div *ngFor="let badge of user.progress.unlockedBadges"> <img id="{{i}}_unlockedImage" *ngIf="badge == achievemen ...

Tips for customizing the appearance of the day button in a React Material-UI date picker

In my React project, I am using material-ui date picker and I am looking for a way to customize the styling of the day buttons. Specifically, I want to change the text color of the available days. By default, as seen in the screenshot, the text color is bl ...

Quick trick to strip decimal points from prices with jquery

Is there a way to remove the decimal point from the price on my website? This is what my HTML looks like: <span id="product-price-4432" data-price-amount="399" data-price-type="finalPrice" class="price-wrapper " itemprop="price"> <span class="p ...

Executing PHP code upon clicking an HTML button

I am currently in the process of creating a simple webpage that will execute a stress test and mimic a load on my web server. The PHP code for stress is functioning properly, however, when I attempt to click the button, nothing seems to happen. <?php ...

jQuery not functioning properly when attempting to add values from two input boxes within multiple input fields

I am facing an issue with a form on my website that contains input fields as shown below. I am trying to add two input boxes to calculate the values of the third input box, but it is only working correctly for the first set and not for the rest. How can ...

Instructions on creating a number increment animation resembling Twitter's post engagement counter

I've been attempting to replicate the animation seen on Twitter's post like counter (the flipping numbers effect that happens when you like a post). Despite my best efforts, I can't seem to make it work. Here is what I have tried: $(fun ...

"Troubleshooting: jQuery Find function not functioning correctly with HTML template

I am having trouble with a Shopify liquid code that I am trying to load into an HTML template <script type="text/template" id="description"> <div class="product-ddd"> {{ product.description }} </div> ...

Is it possible to save an entire webpage that infinitely scrolls without actually manually scrolling through it?

I'm dealing with a webpage that has infinite downward scrolling. I tried automating the scrolling, but eventually the page became too large to continue scrolling. To fix this, I manually removed some DIV blocks from the source code which decreased the ...

The loading feature of jQuery UI Autocomplete - .ui-autocomplete-loading is ingenious

When fetching the XML file for the search box, I would like to apply this css. It currently takes around 3 seconds to load the file. In the autocomplete.js file, I found these two functions: _search: function( value ) { this.term = this.element ...

How can I ensure that the scripts returned in HTML via AJAX are executed when using $.load()?

I have been trying to make an AJAX call and receive a partialView which contains some script that needs to be executed. I did some research and learned about the "eval" method, but then discovered that the $.load() method should handle this for me. Howeve ...

Prevent IonContent from scrolling to the bottom or top when using Ionic framework

In my Ionic app, I have a long text page with 2 buttons that trigger the actions scrollToBottom and scrollToTop. Due to the length of the page, I have set the scroll duration to be 30 seconds. I am facing two issues here: How can I stop the scrolling ...

A step-by-step guide on utilizing img src to navigate and upload images

I would like to hide the input type='file' element with id "imgInp" that accepts image files from users. Instead, I want them to use an img tag to select images when they click on a specific img tag. How can this be achieved using jQuery? Here i ...

Customize the size of table cells in Bootstrap to fit the content

I am working on a table with Bootstrap where each cell contains a button element. I am trying to adjust the width of each cell to accommodate the button and margin, but using <td class="col-md-1"> doesn't seem to make any difference. Is there a ...

Prevent text wrapping and clear floats in a clean and hack-free way

I am currently in the process of compiling a collection of blurbs accompanied by images that can be easily integrated into any section of our website. My goal is to ensure that these blurbs are versatile, free from rigid width specifications, and compatibl ...

Varied elevations dependent on specific screen dimensions

There seems to be a minor issue with the height of the portfolio container divs at specific window widths. The problematic widths range from 1025 to 1041 and from 768 to 784. To visualize this, try resizing your browser window to these dimensions on the fo ...