Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using input-group splits when form.field is added #40850

Open
3 tasks done
jbhrfx9280 opened this issue Sep 18, 2024 · 2 comments
Open
3 tasks done

When using input-group splits when form.field is added #40850

jbhrfx9280 opened this issue Sep 18, 2024 · 2 comments

Comments

@jbhrfx9280
Copy link

Prerequisites

Describe the issue

         <div class="input-group input-group-sm mb-1">
            <span class="input-group-text">With textarea</span>
            {{ form.social_title }}
            <textarea class="form-control" aria-label="With textarea"></textarea>
          </div>

See below example with {{ form.field }} added
image

FYI - I'm new to bootstrap 5 and HTML design, more of a coder so clearly I can be doing this wrong.
Framework: Django

Reduced test cases

         <div class="input-group input-group-sm mb-1">
            <span class="input-group-text">With textarea</span>
            <textarea class="form-control" aria-label="With textarea"></textarea>
          </div>

see below without form.field added

image

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome, Microsoft Edge

What version of Bootstrap are you using?

5.3.3

Copy link
Contributor

Hello @jbhrfx9280. Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case on CodePen or StackBlitz and report back with your link, Bootstrap version, and specific browser and Operating System details.

@AadiSharma49
Copy link

AadiSharma49 commented Sep 19, 2024

Changing behavior to the textarea

<div class="input-group input-group-sm mb-1">
    <span class="input-group-text">With textarea</span>
    <textarea class="form-control" id="myTextarea" aria-label="With textarea"></textarea>
</div>
<button id="btn">Set Text</button>
**And handling form data from textarea**
<script>
    document.getElementById('submitBtn').addEventListener('click', function() {
        let textareaValue = document.getElementById('myTextarea').value;
        console.log('Textarea value:', textareaValue);
        // You can then do something with the textarea value like validation or sending it via AJAX
    });
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants