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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:32:56+00:00 2026-06-16T03:32:56+00:00

Hey guys I have a table that has a main row, a row with

  • 0

Hey guys I have a table that has a main row, a row with a textbox and row with a selectlist that has values of premade comments that when double clicked on need to be populated into the textbox just above it. I am able to get the value of the selected list item into a variable but I can’t seem to find the textbox I am looking for. This is all ran by our DB so I am using classes instead of ids and need to find the previous item with the class name. Heres my code, any help would be great.

NOTE: I am not including the document.ready wrapper but it is in my code.

   $(".mfValues").dblclick(function () {
            var val = $(this).attr("value")
           // alert(val);
            $(this).prev(".mfTextComments").val(val);
        });

   <tr><td><textarea class="mfTextComments" runat="server" cols="20" rows="2" ></textarea></td></tr>";
   <tr><td><select runat=\"server\" style=\"height:20px;\" title=\"Please select a comment from this list by double clicking the comment or create your own in the text area above.\" size=\"4\">
    <option class="mfValues" value="Value1"\">Value1</option>
    <option class="mfValues" value="Value2"\">Value1</option>
    <option class="mfValues" value="Value3"\">Value1</option>
    </select></td></tr>
  • 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-16T03:32:58+00:00Added an answer on June 16, 2026 at 3:32 am

    You were almost there, just need to get out of the < tr > :

    $(".mfValues").dblclick(function() {
        var $this = $(this),
            val = $this.val();
        $this.closest('tr').prev().find(".mfTextComments").val(val);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a Table View that has been populated with 21 data:
Hey guys, I currently have a root table view which has a toolbar at
Hey guys I'm kind of stuck here. I have a table that I need
Hey guys, I have a column in an sql server table that is nvarchar(max).
Hey guys I have an admin page that checks if you are admin before
Hey guys I have one more question lol. I am using a script that
Hey guys I have a query that currently finds the latest comment for each
Hey guys I have a query that selects data and organizes but not in
Hey guys I have an array of dictionaries plist file that I am reading
Hey guys, I have a program that allows me to run queries against a

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.