Inline form malfunctioning and causing issues

Struggling to implement an inline form in Bootstrap using the form-inline class. Despite following the code exactly as specified on the official Bootstrap page, I'm experiencing unexpected behavior.

Here's what I'm seeing:

https://i.sstatic.net/MvalN.png

The given code is:

@using (Html.BeginForm("Edit", "Index", FormMethod.Post, new { @class = "form-inline" }))
{
    <div class="form-group">
        <label for="new-value">Enter new value: </label>
        <input type="text" id="new-value" class="form-control" />
    </div>
    <div class="checkbox">
        <label>
            Public: <input type="checkbox" />
        </label>
    </div>
    <input type="submit" class="btn btn-primary" />
}

Removing the form-control class from the text box resolves the issue and gives the desired outcome at the expense of losing the stylish text box:

https://i.sstatic.net/APJDa.png

I acknowledge the Bootstrap warning that states:

This only applies to forms within viewports that are at least 768px wide.

However, my screen size is large with a form width of 1160px.

Answer №1

Your code has been successfully modified. I trust this meets your requirements!

HTML

<form class="form-inline">
  <div class="form-group">
    <label for="new-value">Please input a new value: </label>
    <input type="text" id="new-value" class="form-control" />
  </div>
  <div class="form-group">
    <div class="checkbox">
      <label> Public:
        <input type="checkbox" />
      </label>
    </div>
  </div>
  <div class="form-group">
    <input type="submit" class="btn btn-primary" />
  </div>
</form>

To see the functioning example, please visit http://www.bootply.com/ZWGwdEcnva

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

establishing the position of the mouse cursor within a scaled div container

Issue at Hand: I'm encountering an obstacle with a transformed div set up as follows: $('#container').css('-moz-transform-origin', '0 0'); $('#container').css('-webkit-transform-origin', '0 0&ap ...

There was a problem encountered while trying to open the dbf file: The external table does not conform to

I am currently using this code snippet to import a dbf file. However, I encountered an error message: 'External table is not in expected format' if (ofdDBF.ShowDialog()==DialogResult.OK) { string connStr = @"Provider=Microsoft.Jet.OLED ...

In the world of C#, treating null database values as empty in a JSON file is the

I am encountering an issue with converting decimal NULL values from a database to a JSON file. There is a SQL procedure that retrieves the values from the database, and a C# function then converts these values into a JSON file. Currently, when the procedur ...

Exploring the Limitless Possibilities of Bootstrap 5 Horizontal Scrolling

Each time I create a new page, there is a slight horizontal scrolling issue that occurs. When the page scrolls horizontally, it leads to a white space where nothing exists beyond the footer and header at the edge of the screen. Even though it's just a ...

Contrast between the expressions '$(<%= DDL.ID %>) and $('<%= DDL.ID %>')

I spent hours trying to attach an event to a drop-down list with no success. I even sought help in a JavaScript chat room, but couldn't find a solution. However, by randomly attempting the following code: $('<%= ddl.ID %>').bind(&apos ...

Encountering a 500 error while making a Jquery and ASP.NET ajax call to a .NET server

After creating an object in the following format : Object {ABC-123: "XYZ", ABC-112: "LAX"} I encountered a 500 error while attempting to send this object to .NET. Here's how I tried to transmit the object: $.ajax({ type: "POST", ...

Singling out a particular navigation tab

When attempting to link specific table IDs so that the corresponding tab is active when opened (i.e. www.gohome.com/html#profile), I am facing an issue where the active tab remains unchanged. Even after specifically calling out tab IDs, there seems to be n ...

Selecting a single checkbox automatically selects all other checkboxes

Is there a way to automatically check all other checkboxes if one checkbox is checked? Here's the code snippet I have: <tr> <td class="small"><asp:CheckBox ID="chkReportModuleName" runat="server" name="report"></asp:CheckBox& ...

"PxToRem: A handy PostCSS plugin for converting pixel units

As a beginner in the world of Node.js and post processors for CSS, I recently took the time to install the following tools after going through multiple articles: Node.js (including npm) Gulp PostCSS Pxtorem (a PostCSS plugin for Gulp) My goal is to util ...

Is there a way to transform a Class Object into a String?

I am facing a challenge with a class object that is retrieved through a web service (WCF). This class contains properties of type String and some custom Class Types. I am trying to figure out how to extract the Property Name and Properties Name of Propert ...

Encountered an issue with filling the dataset using the data adapter, as well

I'm having trouble with a SQL query that I want to save in an XML file. However, whenever I try to run it, I encounter the following error: INVALID COLUMN! This query runs smoothly on SQL server but not here. namespace xxxxxxxxxxxx { public parti ...

Adjust the position of the remaining li elements to accommodate the increased height of a single li element

I am currently working on a dropdown menu and I'm encountering an issue where, in the second level of <ul>, if the height of an <li> increases due to accommodating another <ul>, the other <li> elements in the second level do no ...

Dynamic status bar for WordPress using Advanced Custom Fields

I am currently working on developing an order tracking system using Wordpress, ACF, and a form plugin that is yet to be determined for the user interface. While the back-end functionality is working smoothly, my focus now shifts towards creating a visual ...

A series of 8 columns lined up neatly in Bootstrap 4

In need of a row with 8 columns on a large device and fewer columns on a smaller device. Bootstrap's 12-grid system only offers predefined classes like col-1, col-2, col-3, col-4, col-6, and col-12, making it impossible to have a row with exactly 8 c ...

Is it possible for CSS to accurately crop images by pixels [Sprite Box]?

I attempted to replicate the math used for the previous image cuts and added my own image, but it appears blank. Can you identify where the issue lies? #paymentForm { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webk ...

"Removing the blue initial loader from Filestack during initialization: A step-by-step guide

Currently, I am facing an issue with a button that triggers the filestack uploader in my React application. The functionality works as expected, but I am struggling to override the default blue spinner/loader that is displayed with the filestack uploader. ...

How can you easily center content vertically on a web page?

There has been plenty of back-and-forth regarding this issue, with proposed solutions ranging from pure CSS to pure HTML. Some can get quite complex, involving deeply nested divs and intricate CSS rules. I'm looking for a simple and uncomplicated answ ...

The control in HTML vanishes following an AJAX postback

I'm dynamically generating the Div elements within the RadPanelBar using jquery. Everything works fine when the page first loads. However, if I collapse and then expand the RadPanelBar, the generated div elements disappear. This is how I'm curre ...

Ways to effectively incorporate Bootstrap into Lit?

Currently, I am in the process of converting a website from Polymer to Lit. I have made good progress with it, but I have encountered a roadblock when it comes to styling. In order to simplify development and focus on functionality, I have been following t ...

Is it possible to create a query selector that is able to find an element based on its attributes while also excluding elements with a specific class name?

Imagine you have elements that look like this: <div class="a b" data-one="1" data-two="2"></div> <div class="c" data-one="1" data-two="2"></div> <div class="b" data-one="1" data-two="2"></div> Is there a way to selec ...