Adjusting dimensions of text entry box in popup window

As a newcomer to the coding world, I'm seeking guidance on how to resize a textbox control inside a modal window. Despite setting the width property, the textbox only occupies half of the modal window. Here's how I've structured the modal window:

<div id="BusinessRejectModal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Enter reason for rejection</h4>
            </div>
            <div class="modal-body">
                <asp:TextBox ID="txtBusinessRejectModal" runat="server" Height="300px" TextMode="MultiLine" Width="1000px"></asp:TextBox>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btn-lg" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

Although I've experimented with various width values in the bootstrap.css file, the issue persists. How can I properly format the text box within the modal window? Would appreciate any insights or solutions!

Answer №1

If you're utilizing the bootstrap framework, it's recommended to make use of the class=form-control and insert the textbox within

<div class="form-group"></div>
as shown below:

<div class="form-group">
    <asp:TextBox ID="txtBusinessRejectModal" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
</div>

This will adjust the height and width within <div class="modalbody">

View Fiddle Example

If you wish to increase the height of the textbox to, let's say, 10 rows, simply add rows="10" inside the textbox. This allows flexibility in adjusting the height of the textbox without specifying height / width

<div class="form-group">
    <asp:TextBox ID="txtBusinessRejectModal" runat="server" CssClass="form-control" Rows="10" TextMode="MultiLine"></asp:TextBox>
</div>

Example with 10 rows

Please note: The examples in the fiddles demonstrate the use of HTML textarea to illustrate how to leverage the bootstrap framework.

Answer №2

Thank you so much for getting back to me. Even though I copied and pasted your code exactly, the textbox was still not displaying correctly.

However, I was able to figure out the issue. It turns out that the problem was caused by a snippet of code in my Site.css file:

    textarea {
max-width: 280px;
text-align: left;
}

The 280px width setting was affecting the size of the textbox.

Despite the issue, I appreciate your response. It was helpful to see a functioning example and realize that my code should work properly if not for that conflicting setting.

Thanks again, Brady

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

Handling null session values by converting them to empty strings in C# programming

When it comes to web programming, I am well-versed in using VB.net. Typically, I find myself doing something like this: Dim s as string = Session("s") Here, I retrieve a string value for s from the web session. If there is no value stored, I simply rece ...

Creating a custom authentication filter for controllers in .NET Core with bearer token authentication

I'm diving into the world of bearer authentication and looking to set up a simple system on my controllers. I decided to extend the Startup.cs: public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { //... app.UseAuthorizatio ...

Drag and Drop Files onto a Website (Without Flash)

I've been tasked with finding a way to allow users to copy and paste files directly into a website. The catch is, it can't involve flash but Silverlight is an option. It's only required to work on Windows/IE, and drag and drop functionality ...

Obtain a compilation of weekly schedules for a year, complete with corresponding dates

My mind is exhausted from trying to figure this out, but it's late on a Friday and I feel like I'm going in circles. I am trying to come up with a list of working weeks for a drop-down menu, where the week number would be the value. For example: ...

How can you achieve three layers of nested quotes in Dynamic HTML?

Working on an app that utilizes JQuery and JQTouch for iOS. The issue I'm facing involves dynamically generated HTML lists where the user clicks a row that needs to be highlighted. However, achieving this has proven tricky due to nesting 3 sets of quo ...

What is the best way to position a button in the center?

I am attempting to position the add button in the middle of the box, not just centered, but truly in the middle of it. .gallery { background-color: #fbfbfb; border-radius: 5px; border-style: solid; border: 1px solid #bbbbbb; height: 85px; li ...

Personalized color scheme for calendar td

I am facing an issue with my event calendar where I want to change the background color of td. I came across a helpful solution in this question, but it did not fully solve my problem. When I implemented the following jquery: $('[class*="fc"]'). ...

tips for creating a mobile-friendly responsive button

I have been scouring the internet for a solution to this issue. Essentially, I am trying to position the button on the right side in desktop view. Here is an example: chrome view However, when the site is resized or viewed on mobile devices, the button sh ...

Comment ajouter un élément HTML <a> dans l'en-tête d'une colonne d'un GridView en asp.net

I'm currently gaining experience with asp.net/webforms for my internship. I need to showcase a GridView filled with data from a class. I've managed to dynamically create my GridView using BoundField. However, I would like the HeaderText of each c ...

sequentially animating elements using animate css in a choreographed manner

I have created a unique jsfiddle with 20 boxes that I am trying to animate using the Animate.css plugin. The plugin can be found at daneden.me/animate. My goal is to animate each box one after the other in a sequential manner, but I seem to be having trou ...

Visibility of text compromised when placing transparent button inside input field

After adding a clear button inside the input box in Angular, I am facing an issue where the text in the input box is being overlapped and not fully visible. Below you will find detailed information on this problem. HTML Code <ng-template pTemplate=&quo ...

ASP.NET Button not Responding to Click Event

As a student on a work placement, I have taken over an app that is "semi-finished". The app is written in C# (no experience), .NET (limited experience), has AJAX functionality (no experience), and uses JQuery (limited experience). I implemented a method to ...

The unexpected blank space appearing beneath my website as a result of images and videos placed on the

There seems to be some random white space on my website between the main body elements and the footer. Interestingly, removing the cat image and videoplayer eliminates this white space. However, I don't want to remove them completely, so I'm tryi ...

How can I ensure my md-sidenav takes up the entire height when using ui-router?

Currently, I am utilizing the most recent version of Angular Material (1.0.0) library and I am attempting to ensure that my <md-sidebar> panel occupies the entire height of the available space on the webpage. While it functions correctly on a regul ...

Using jQuery to animate a div when clicked by the mouse

Here's the scenario: I have 3 block elements arranged in a specific order: Image Hidden Text Block (.hidden) Footer Block (.blockimage) When the page loads, the image is displayed over the hidden text block (which contains further infor ...

Adaptive component transformation

Hey there, I'm having some trouble figuring this out... I need help with making sure that the element identified by the red rectangle in the images moves in alignment with the containers below, regardless of the screen size. I want to create a respon ...

Right-align the text in the title of the material card

Why isn't the CSS aligning my title of matcard to the right? <mat-card [ngStyle]="{ 'margin':'5px','height':'130px'}"> <mat-card-header> <mat-card-title [ngStyle]="{ 'text-align': ...

Bootstrap navbar partially collapsed with inner items concealed not at the edges

Many discussions have come up regarding partially collapsing Bootstrap navbars, such as: Item1 Item2 Item3 Item4 Item5 Is it possible to achieve the following collapsed format: Item1 Item2 Item3 =menu= Or: =menu= Item3 Item4 Item5 This method ...

How come the h2::after element is positioned directly beneath the main h2 element, and with a margin-bottom?

I'm puzzled as to why the margin-bottom property in the main h2 element isn't affecting its "::after" element. Both are defined as block elements, so one margin should provide enough space between them. Even though the "h2::after" element has 0 m ...

How can we eliminate all elements from jQuery except for the first and second elements?

HTML <div class="geo_select"> <h3>header 3</h3> in Above HTML code i want to remove all element except <h3> and default content<div> inside the <div class='geo_select'> in jquery.. How to remove all ...