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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:41:31+00:00 2026-05-21T08:41:31+00:00

I have a simple like this: <textarea id=ind_comment rows=4 cols=32></textarea> Then I have the

  • 0

I have a simple like this:

<textarea id="ind_comment" rows="4" cols="32"></textarea>

Then I have the following:
There is a hidden field and a button which has the class “showComment”. If there is a value in the hidden field the textarea should be populated with that value.

$(".showComment").click(function(){
    var rowid       = $(this).attr("rowid");
    var hiddenid    = "line_" + rowid + "_new_cmt";

    $("#ind_comment").val($("#line_" + rowid + "_new_cmt").val();

    var x = $(this).position().left + ($(this).outerWidth() -350);
    var y = $(this).position().top - $(document).scrollTop();

    $("#dialog").dialog({ 
        bgiframe: true,
        position: [x,y],
        width: 400,
        height: 200,
        title: "Comments specific to this entry",
        modal: true,
        buttons: { "Close": function() { 
            $("#line_" + rowid + "_new_cmt").val($("#ind_comment").val());
            $("#ind_comment").val("");
            $(this).dialog("destroy"); 
        }}
    });
});

$(“#ind_comment”).val(“”); clears the value as it should.

In FF4 (Windows or OS X)

$("#ind_comment").val(document.getElementById(hiddenid).value);

does not work but it works just fine in IE (tested with 8) and FF 3.x

I’ve also tried:

$("#ind_comment").val($("#line_" + rowid + "_new_cmt").val();

with no luck.

This is with jQuery 1.5.2

Am I missing something or is there an issue with FF4?

Here’s a jsFiddle Demo…It works the first time, but not the second time either of the buttons is clicked.

  • 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-21T08:41:32+00:00Added an answer on May 21, 2026 at 8:41 am

    Seems that all the other examples left out the jquery dialog part…maybe that’s where the issue is…?

    While the jquery is a bit of a rat’s nest why go through all the extra hoops?

    1. Change the hidden input to a textarea
    2. Wrap that textarea in it’s own div
    3. When the button is clicked turn that wrapped textarea into the dialog instead of using the one div as the text area

    That way you avoid the need to swap the text in and out and such…

    Might make it easier in the long run…

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

Sidebar

Related Questions

I have simple form like this which accepts only two values string action and
I have a functions.php page with a simple textarea, like this: <tr valign=top> <th
I have a simple text area in a form like this: <textarea style="width:350px; height:80px;"
I have a simple HTML page with a large textarea form field and button.
I have a simple form which is like this: The HTML: <form action=post> <input
I have a simple list like this: <ul id=cyclelist> <li>Item 1</li> <li>Item 2</li> <li>Item
I have a simple model like this one: class Artist(models.Model): surname = models.CharField(max_length=200) name
I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
Suppose you have a simple class like this: class foo{ private: int* mData; int
I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>

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.