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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:22:50+00:00 2026-05-21T19:22:50+00:00

First time using jQuery parent and got confused, here’s my html: <div id=friends_inveni class=friends_rec

  • 0

First time using jQuery parent and got confused, here’s my html:

<div id="friends_inveni" class="friends_rec" style="">
    <br>
    <div style="height: 280px; overflow-y: auto;">
        <div style="width:150px;float:left;font-size:11px;color:White;">
            <input type="checkbox" name="friends" value="3265" id="friend_3265">
            <img style="width:24px;vertical-align:middle;" src="https://graph.facebook.com/661382259/picture">
            Test1
        </div>
        <div style="width:150px;float:left;font-size:11px;color:White;">
            <input type="checkbox" name="friends" value="3265" id="friend_3265">
            <img style="width:24px;vertical-align:middle;" src="https://graph.facebook.com/599567764/picture">
            Test2
        </div>
    </div>
    <br clear="all">
    <div class="action_new_comment">
        <textarea class="action_comment_input" onkeyup="check_height(this);" style="height:36px;"></textarea>
        <br clear="all">
        <a class="action_btn" style="font-size:11px;" name="comment" id="A1">Send Recommendation</a>
    </div>
</div>

Here’s my jQuery code:

jQuery(document).ready(function() {
        $(".action_btn").live('click', function() {
            var friends = new Array();
            $(this).parents('.recommend').find('input:checked').each(function(k) { friends[k] = $(this).val(); });
            var comment = $(this).parents('.recommend').find('textarea').val();

            if (friends.length == 0) {
                alert('Please select at least one friend.');
            } else {
                $.post("update.php",
                    { uid: <?php echo $_SESSION['uid']; ?>, mid: <?php echo $_GET['mid']; ?>, friends: friends, comment: comment },
                    function() {
                    var newComment = $('<div  class="bubble_confirmation"><h1>Recommendation Sent!</h1><br /><br > <a href="#" onclick="$(this).parent(\'div\').remove();return false;">Send more</a></div>');
                        $(this).parents('.recommend').append(newComment.fadeIn());
                        $(this).parents('.recommend').find("input:checkbox:checked").attr("checked", "");
                        $(this).parents('.recommend').find('.action_comment_input').val('');
                    });
            }
        });
    });

Issue is that:
1. I can’t get the content of the textbox
2. I can’t get the array of userid

Why is this?

  • 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-21T19:22:51+00:00Added an answer on May 21, 2026 at 7:22 pm

    It looks as though your HTML class friends_rec should be recommend, judging from your jQuery code.

    Also, since we don’t know what $(el) is, that should probably be $(this), instead.

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

Sidebar

Related Questions

I'm using the jQuery DatePicker control for the first time. I've got it working
I am using jQuery-ui slider for the first time and am confused by a
I am using jQuery for the first time to add a class to an
I'm using Ajax via jQuery for the first time ever. I have an html
I'm working on a site and using JQuery for essentially the first time. I've
this is my first time using jquery, and i dont think it seems to
This is my first time using JQuery in any of my projects. I have
Preface: First time really using JavaScript + jQuery, so my problem likely stems from
I am using jquery layout for the first time. I have it working using
I have a website that consists of one parent page. Using the lightbox-style jQuery

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.