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 5839405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:34:48+00:00 2026-05-22T11:34:48+00:00

Solution here: http://jsfiddle.net/kralco626/E9XVr/53/ Note: I think this is a duplicate of this question: how

  • 0

Solution here: http://jsfiddle.net/kralco626/E9XVr/53/

Note: I think this is a duplicate of this question: how to show text area on button click? However, the OP of that question never followed up and I don’t think any of the answers actually answer the question. I think Tomalak’s comment on that question

Seems to me that, if anything, he wanted to pop up a textarea, wait for input into it, have the user press some ‘OK’ button then store the result in a variable.

Pretty much sums it up.

When the user clicks a button, I would like a text area to open in which the user can enter some text click an OK button and then the text area will close.

I don’t want a dialog box, it’s too intrusive, I want just a plain simple textarea or similar to open so that the top left of the text area is positioned at the bottom left of the button.

Thanks!

<span style="width:20px;height:20px" class="remarkButton"></span>

$(".remarkButton").button({ icons: { primary: "ui-icon-pencil" }, text: false }).click(function () {
       $(...something to show text area...).data("$clickedButton",$(this));
});

//called when the OK button on the text area is clicked
function saveRemark($referenceToTextArea)
{
$referenceToTextArea.data("$clickedButton").data("remark",$referenceToTextArea.text());
}

enter image description here

  • 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-05-22T11:34:49+00:00Added an answer on May 22, 2026 at 11:34 am

    OK, I’ve knocked something up very quickly — it doesn’t exactly match your specifications, but it’s something similar. See jsFiddle.

    The Javascript:

    $('#foo').click(function() { // the button - could be a class selector instead
        var button = $(this),
            commentField = $('<textarea/>'); // create a textarea element
    
        commentField
            .css({
                position: 'absolute', 
                width: 200,          // textbox 200px by 100px
                height: 100,
                // position the textarea directly over the button
                left: button.offset().left + (button.outerWidth() / 2) - 100,
                top: button.offset().top + (button.outerHeight() / 2) - 50
            })
            // set the textarea's value to be the saved content, or a default if there is no saved content
            .val(button.data('textContent') || 'This is my comment field\'s text')
            // set up a keypress handler on the textarea
            .keypress(function(e) {
                if (e.which === 13) { // if it's the enter button
                    e.preventDefault(); // ignore the line break
                    button.data('textContent', this.value); // save the content to the button
                    $(this).remove(); // remove the textarea
                }
            })
            .appendTo(document.body); // add the textarea to the document
    });
    

    The main difference to the specification is that the textarea closes when you press “enter”, not on clicking a button. It wouldn’t be hard to modify if that’s what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my jsfiddle example: http://jsfiddle.net/7PqqT/ Update: This is my work around solution: http://jsfiddle.net/7PqqT/1/ However
I got a CSS question related to this fiddle: http://jsfiddle.net/r584e/ Here the relevant screenshot
I can't find any solution to this problem. Here's the render I want: http://jsfiddle.net/kQSxb/
Is there any way to make this solution IE6 and IE7 compatible? http://jsfiddle.net/kirkstrobeck/sDh7s/1/ Pulled
http://jsfiddle.net/motocomdigital/7fyvn/1/ Hello, this is a question I'm really struggling to find an answer for.
I've got a working version of my code here: http://www.jsfiddle.net/brianrhea/5Hqs3/1/ When I hover over
here are the codes and preview >> http://jsfiddle.net/shingou/PGFxZ/ as you can see I've used
Have a look at this fiddle: http://jsfiddle.net/h4VS7/ How do I make the yellow element
Here is the JSFiddle link: http://jsfiddle.net/stapiagutierrez/48yGU/34/ When I use padding: 10px; on the #middle
Here's my code: http://jsfiddle.net/ybCN5/ I do not know why it does not work. I've

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.