Attempting to align my range picker horizontally in a single row

After selecting the date range option from my dropdown button, I noticed that the date range options are stacking on top of each other instead of appearing in the same row. Has anyone encountered this issue before? One solution I attempted was adjusting the width using both pixels and percentages, but this caused the entire card to stretch to the right. Any insights into why this is happening would be appreciated.

This is the default appearance before selecting "Date Range" from the dropdown menu. https://i.sstatic.net/IsLaE.png

When the "Date Range" option is selected, the options appear stacked vertically. Ideally, they should be displayed on a single row. https://i.sstatic.net/pqPFG.png

Adjusting the width property in CSS resulted in the card stretching to the right, which is not the desired outcome. https://i.sstatic.net/RFrbl.png

<div class="report-card-i report-card-i-height" style="position: fixed; z-index: 10; background-color: #fff; float: unset; top: 80px;  padding-left: 100px; padding-right: 85px;">


            <h1>ABC Corp - Summary</h1>

            <div class="col-lg-3 text-center">
                @{
                    <select onchange="updateDates(this, null, null, null )">
                        <option value="0" selected></option>

                        @for (int i = 1; i < @Model.droplist i++)
                        {
                            var tempValue = i;
                            <option value="@tempValue">@Model.droplist.ElementAt(i)</option>
                        }
                    </select>
                }
            </div>
            <div class="col-lg-8" id="dateRange" style="display: none; width:1px">
                <div class="col-lg-2">
                    <div class="input-group date" id="divFrom">
                        <div class="form-line">
                            <input id="startDate" name="startDate" type="text" class="form-control" style="background-color: inherit; width: 85px" placeholder="dd/mm/yyyy" value="@Model.StartDate">
                        </div>
                        <span class="input-group-addon">
                            <i class="fa fa-orange fa-calendar"></i>
                        </span>
                    </div>
                </div>

                <div class="col-lg-2">
                    <span class="font-13 text-muted div-center">to</span>
                </div>
                <div class="col-lg-2">
                    <div class="input-group date" id="divTo">
                        <div class="form-line">
                            <input id="endDate" name="endDate" type="text" class="form-control" style="background-color: inherit; width: 85px" placeholder="dd/mm/yyyy" value="@Model.EndDate">
                        </div>
                        <span class="input-group-addon">
                            <i class="fa fa-orange fa-calendar"></i>
                        </span>
                    </div>
                </div>
                <div class="col-lg-2">
                    <button id="btnTest" class="btn-orange fa-orange btn-sm" onclick="updateDateRanges()" style="margin-left: 10px">Submit</button>
                </div>
            </div>
            <br />
            <br />
                    <div class="fa-orange m-t-10 m-b-15 m-l-80">
                        <div class="row col-lg-12">
                            <div class="col-sm-2 col-xs-2 text-left">
                                &nbsp;
                            </div>
                            <div class="col-sm-2 col-xs-2 text-left">
                                <h4>Number of Deliveries</h4>
                            </div>
                            <div class="col-sm-2 col-xs-2 text-left">
                                <h4>Deliveries per day</h4>
                            </div>
                            <div class="col-sm-2 col-xs-2 text-left">
                                <h4>Gross Amount Due</h4>
                            </div>
                            <div class="col-sm-1 col-xs-1 text-left">
                                &nbsp;
                            </div>
                            <div class="col-sm-1 col-xs-1 text-left">
                                <h4>Monthly Total</h4>
                            </div>
                            <div class="col-sm-1 col-xs-1 text-left">
                                &nbsp;
                            </div>
                            <div class="col-sm-1 col-xs-1 text-left">
                                <h4>YTD Total</h4>
                            </div>
                        </div>
                    </div>
        </div>

Answer №1

There seems to be a structural issue. Please try the following steps:

<div class="row">
        <div class="col-lg-4 text-center">
            @{
            <select onchange="updateDates(this, null, null, null )">
                <option value="0" selected></option>

                @for (int i = 1; i < @Model.droplist i++) { var tempValue=i; <option value="@tempValue">
                    @Model.droplist.ElementAt(i)</option>
                    }
            </select>
            }
        </div>
        <div class="col-lg-8" id="dateRange">
            <div class="row">
                <div class="col-lg-3">
                    <div class="input-group date" id="divFrom">
                        <div class="form-line">
                            <input id="startDate" name="startDate" type="text" class="form-control"
                                style="background-color: inherit; width: 85px" placeholder="dd/mm/yyyy"
                                value="@Model.StartDate">
                        </div>
                        <span class="input-group-addon">
                            <i class="fa fa-orange fa-calendar"></i>
                        </span>
                    </div>
                </div>
                <div class="col-lg-3">
                    <span class="font-13 text-muted div-center">to</span>
                </div>
                <div class="col-lg-3">
                    <div class="input-group date" id="divTo">
                        <div class="form-line">
                            <input id="endDate" name="endDate" type="text" class="form-control"
                                style="background-color: inherit; width: 85px" placeholder="dd/mm/yyyy"
                                value="@Model.EndDate">
                        </div>
                        <span class="input-group-addon">
                            <i class="fa fa-orange fa-calendar"></i>
                        </span>
                    </div>
                </div>
                <div class="col-lg-3">
                    <button id="btnTest" class="btn-orange fa-orange btn-sm" onclick="updateDateRanges()"
                        style="margin-left: 10px">Submit</button>
                </div>
            </div>
        </div>
    </div>

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

Modifying icons with JavaScript

When I click on the play icon, it changes to the pause icon. However, I am only able to change the first icon from play to pause in my JavaScript code. How can I apply this functionality to all the audio elements on the page? let playIcon = "https://ima ...

The correct method for implementing server-side rendering with JavaScript

My website consists of multiple pages and utilizes React as a widget toolkit, with different bundles on each page. I am facing an issue where some widget state persists within a login session, and when the user revisits the page, the components should relo ...

use a loop to add various html meta tags to the header section

In the midst of developing a Shopware plugin, my focus is on adding meta data to the html tag head. Utilizing twig, I extend a template and incorporate code into it. By triggering an event, I pass an array of meta entities mykn_metaFields to my twig templa ...

Designing a unique customized top navigation bar in Magento 1.9.2

I recently attempted to create a unique top menu in magento 1.9.2 by modifying the Navigation.php file located at app/code/core/Mage/catalog/Block/. I added some custom classes in an effort to customize the menu. In order to achieve this customization, I ...

Using Jquery to Switch Pages

Recently, I've been experimenting with using hashes to create animated transitions between pages. Interestingly, the first page that loads (the home page) fades in and out seamlessly. However, when I attempt to navigate to another page, specifically t ...

Is it possible to superimpose a post-type title onto the featured image?

I have crafted this WP_Query to extract the titles and featured images from my post types. <div class="job-cont"> <?php $query = new WP_Query( array( 'post_type' => 'jobs' ) ); if ( $query->have_posts( ...

Disappearance of icon upon hovering in CSS

I am currently working with Angular JS (1.x) and I have a requirement to display tooltip text when hovering over an info icon. The tooltip text appears properly, but the issue is that the icon disappears when hovered over. It reappears once the hover is re ...

The attempt to update a div element in HTML using an Ajax function was unsuccessful

My attempt to showcase the search results of my webpage below the search area was unsuccessful. I utilized AJAX to present the outcome in a div, but encountered issues. I have three key components: the div, the search result page, and the AJAX function. ...

elevate the shadow of the menu bar above the background image

How can I ensure that the drop shadow of the menu appears in front of a background image within a div? See below for my CSS code nav { width:900px; margin: 4px auto 0px 8%; font-size: 16pt; padding-bottom: 0px; -moz-box-shadow: 7px ...

Customizing the appearance of charts in AngularJS using the Chart.js

I just started experimenting with AngularJS and recently created a horizontal bar chart using Chart.js and HTML. My next step is to make the chart dynamically appear on the page with the help of AngularJS. Can someone please provide some guidance on how I ...

One Page HTML5 with a Bootstrap fixed top menu, revealing content on menu item click

Is there a way to have the Bootsrap mobile menu automatically unfold when a link (anchor on the same page) is clicked? The menu unfolds with class navbar-collapse collapse in The menu folds with class navbar-collapse collapse out I already have an oncl ...

Using AJAX to dynamically load content from a Wordpress website

Currently, I have been experimenting with an AJAX tutorial in an attempt to dynamically load my WordPress post content onto the homepage of my website without triggering a full page reload. However, for some reason, when clicking on the links, instead of ...

Link the html button with the php code in order to perform a specific action

I am looking to link my HTML code with PHP in order to achieve the following functionality: 1. Create a cookie that prevents a specific message from being displayed again when a certain button is clicked. 2. Hide messages using CSS after the button clic ...

Generating CSS Selectors with JavaScript

Presently, I am attempting to devise CSS Selectors using JavaScript specifically tailored for particular web browsers and mobile devices. The current method in place is as follows: // IDENTIFY BROWSER AND APPLY CORRESPONDING CSS METHOD function getBr ...

delete the initial background color assigned to the button

The "ADD TO CART" and "save design" buttons are currently displaying as shown in the image below. I would like to make the "SAVE DESIGN" button look similar to the "ADD TO CART" button, meaning I want to remove the background-color and dot symbol. Code ...

Modify the HTML of the page after altering the dropdown selection

I have a total of 3 pages, including the main page. I am looking to access the first and second pages by changing the dropdown list selection. This is my jQuery code within my HTML file named main.html. <html> <head> <link rel=&quo ...

You may only insert a single image into a container

My goal is to display two images side by side with text centered between them. However, when I add the first image using CSS and the background property, I run into issues adding a second image as it overrides the first one. Placing the images directly in ...

Single-line form with labels positioned above the input fields

For my web app project, I am using AngularJS and Bootstrap 3 for CSS (although my CSS knowledge is limited). I am trying to design an inline form with 5 input fields and labels positioned on top of them. The first field should take up more space than the o ...

Loading message displayed in web browsers by banner rotation system

I'm currently working on a banner rotator function that seems to be showing a "loading" message continuously while running. Here is the code snippet for reference: var banners = ['../Graphics/adv/1.gif','../Graphics/adv/2.jpg']; / ...

Expand the width of the navbar brand icon

Currently working on a landing page project and noticed that my logo appears too small, utilizing Bootstrap 5 style.css ... .navbar-brand { width: 3.5rem; padding: 0 0; margin: 0.3rem 0; position: relative; } .navbar-brand img { width: 100%; ...