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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:34:53+00:00 2026-06-16T13:34:53+00:00

basically i’m attempting to target elements only within the parent db_update div class of

  • 0

basically i’m attempting to target elements only within the parent db_update div class of the input field that triggers on blur, however it’s targeting any class with a matching name, which is not what I want. Ignore the AJAX part as it’s irrelevant for now.

I think the problem lies with it targeting the input element on blur, and it’s not able to chain to the parent element successfully.

Basically whichever URL input box i click on is which fields it should fill out, not both.

http://jsfiddle.net/SXWXu/6/

HTML

<div class="db_update">
<p style="font-size: 12px;"><span style="font-weight: normal;">SLIDE URL: <input type="text" class="slide_URL"  /></span></p>
<div class="status_message"> </div>
<p style="font-size: 12px;"><span style="font-weight: normal;">Slide #: <input type="text" class="slide_num" readonly/></span></p>
<p style="font-size: 12px;"><span style="font-weight: normal;">Document #: <input type="text" class="doc_num" readonly/></span></p>
<p style="font-size: 12px;"><span style="font-weight: normal;">Filter(F): <input type="text" class="filter_num" readonly/></span></p>
</div>

<br/>
<div class="db_update">
<p style="font-size: 12px;"><span style="font-weight: normal;">SLIDE URL: <input type="text" class="slide_URL"  /></span></p>
<div class="status_message"> </div>
<p style="font-size: 12px;"><span style="font-weight: normal;">Slide #: <input type="text" class="slide_num" readonly/></span></p>
<p style="font-size: 12px;"><span style="font-weight: normal;">Document #: <input type="text" class="doc_num" readonly/></span></p>
<p style="font-size: 12px;"><span style="font-weight: normal;">Filter(F): <input type="text" class="filter_num" readonly/></span></p>
</div>

Jquery

$(document).ready(function() {


$('input[class=slide_URL]').on({

   blur: function(){
    var status_message = $('.status_message');
    var query_string = encodeURIComponent($(this).val()); 
    var dataString = 'query_string='+ query_string;

     $.ajax({
      type : 'GET',
      url: '',
      dataType : 'json',

      data:  dataString ,
      error : function(XMLHttpRequest, textStatus, errorThrown) {


          $(this).parent().find('.slide_num').val(140);
            $('.doc_num').val(140);
        $('.filter_num').val(140);

      status_message.removeClass().addClass('failure').text('Request was not sent.').show(200);},

      success : function(data) {


       if (data.error === true)
       {


     status_message.show().removeClass('success').addClass('failure').text(data.msg).stop().fadeOut(3000);


     }
    else {
     status_message.show().removeClass('failure').addClass('success').text(data.msg).stop().fadeOut(3000);




         }
     } 
       });    
 return false; 

   }
 });
 });
  • 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-16T13:34:54+00:00Added an answer on June 16, 2026 at 1:34 pm

    Use .closest() to get the .db_update ancestor of the blurred element and then .find() to find the required status_message.

    var status_message = $(this).closest('.db_update').find('.status_message');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I wrote a script that generates a xml file based on user input.
Basically, I want two different elements in the leftmost area of a div, and
Basically I have code that initialises the database in a DatabaseHelper extended class (see
Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.
Basically I've made a form in Cakephp 2.1 with a jQuery button that appends
Basically from C++ FAQ I learned that: A virtual function allows derived classes to
Basically, what I'm trying to create is a page of div tags, each has
Basically Oracle states that the self-contained applications ( which I want to use )
Basically I have a class called Asset which holds all the information for an
Basically I have two xibs, the first one is the main xib that contains

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.