Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7928691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:48:56+00:00 2026-06-03T19:48:56+00:00

I want the button to submit the form while the textarea is expanded. How

  • 0

I want the button to submit the form while the textarea is expanded. How do i do this?

The problem is that when I click the Post button in the form, while the textarea is expanded, it does not submit the form, instead it shrinks back down, and I need to click it again while it is smaller, to submit the form.

Currently in order to submit the post, i need to click the post button while the textarea is not expanded.

HTML

<form method='POST' action='elsewhere.php'>
    <textarea id="textarea" style="width:550px; height:25px;"></textarea>
    <input class="btn" type='submit' value='Post'/>                             
</form>

jquery

Currently when I click the text area, the height expands, and when i click elsewhere it shrinks. when i click the post button, while the textarea is expanded it doesnt submit the post, intead it shrinks the textarea back down.

$('#textarea').click(function(){
    $(this).css('height','100px')
    $(this).html('');
    $(this).blur(function(){
        $(this).css('height','25px')

    });
})
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:48:58+00:00Added an answer on June 3, 2026 at 7:48 pm

    I think its some z-index related issue. Try giving position: relative; z-index:1; to the submit button.

    If you have set z-index for the textarea or any of its ancestors, increment that value by one and set it to the button.

    There is a chance of the button being overlapped by the textarea while increasing its height.
    And you too mentioned that, while the textarea is expanded it doesnt submit the post. It may be because of the button is overlapped.

    Update:

    I got it after

    The problem is that when I click the Post button in the form, while the textarea is expanded, it does not submit the form, instead it shrinks back down, and I need to click it again while it is smaller, to submit the form.

    $('#textarea').click(function(){
    $(this).css('height','100px')
    $(this).html('');
    $(this).blur(function(){
        if(this.value === ''){
            $(this).css('height','25px')
        }
    
    });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html form with no submit button. I want to submit that
I have a form which I want to submit upon button click which is
I have a form that uses jQuery Validate. You click the Submit button, form
I have a submit buttom like this: <?php echo <form id='abottom' method='post'> <button name='.$row3[$ww].'
When a user clicks a submit button I want the form to be submitted.
I want to make preview button as usual form button next to submit button(as
I want a simple form with one text box and a submit button. For
I have a form, and want to disable/enable its submit button depending on whether
i want to create a form that has two submit buttons, but each one
Got a working AJAX form: @using (Ajax.BeginForm(...)) I want to disable the button while

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.