When using input-group splits when form.field is added
Prerequisites
- [X] I have searched for duplicate or closed issues
- [X] I have validated any HTML to avoid common problems
- [X] I have read the contributing guidelines
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
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
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
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.
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>
I am wild guessing, that the form tag {{ form.social_title }} is being replaced with 'title text' element with the class class="form-control" causing the issue cum as intended for "input-group".
And what exactly are you trying to achieve? Trying to set placeholder text for the textarea?
As the issue was labeled with awaiting-reply, but there has been no response in 14 days, this issue will be closed. If you have any questions, you can comment/reply.