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

  • Home
  • SEARCH
  • 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 6710161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:59:24+00:00 2026-05-26T07:59:24+00:00

Let me share my jQuery part first $(.btnUpdateInput).click(function() { //alert(Update); var BldDocumentId = $(#BldDocId).val();

  • 0

Let me share my jQuery part first

$(".btnUpdateInput").click(function() {
            //alert("Update");
            var BldDocumentId = $("#BldDocId").val();

            var BldinstructionId = $("#BldIPInstnId").val();
            var InputFieldId = $("#InputFieldId").val();
            var InputFieldValue = jQuery.trim($(this).parent().prev().text()); //$("#InputFieldValue").val();
            var InputFieldUserValue = jQuery.trim($(this).prev().val()); // $(".user_input_value").val();
            alert(BldDocumentId + "," + BldinstructionId + "," + InputFieldId + "," + InputFieldValue + "," + InputFieldUserValue);

            var postResult;
            alert($(this).get());
            $.post("/Build/UpdateInputField",
                { bldDocId: BldDocumentId, bldInstnId: BldinstructionId, inputFieldId: InputFieldId, inputFieldValue: InputFieldValue, inputFieldUserValue: InputFieldUserValue },
                function(result) {
                postResult = result;
                    //Either this should function**
                    alert($(this).get()); // returned Object[Object] but expected the clicked button
                    alert($(this).parent().get());// returned null
                    alert($(this).parent().next().get());//returned null
                    alert($(this).parent().next().children().first().get());// returned null

                    // $(this).parent().next().show();
                    // $(this).parent().next().children().first().text(InputFieldUserValue);
                    // $(this).parent().hide();
                });

                alert(postResult);
            //Or this should function**
            if (postResult == true) {
                $(this).parent().next().show();
                $(this).parent().next().children().first().text(InputFieldUserValue);
                $(this).parent().hide();
            }
        });

Now let me explain my issue. I need to show and hide few divs with respect to the button “btnUpdateInput” I clicked. I tried it in two ways: 1. I gave the following lines in the in the success part of $.post

$.post("/Build/UpdateInputField",
                { bldDocId: BldDocumentId, bldInstnId: BldinstructionId, inputFieldId: InputFieldId, inputFieldValue: InputFieldValue, inputFieldUserValue: InputFieldUserValue },
                function(result) {
                postResult = result;
                    //Either this should function**
                    alert($(this).get()); // returned Object[Object] but expected the clicked button
                    alert($(this).parent().get());// returned null
                    alert($(this).parent().next().get());//returned null
                    alert($(this).parent().next().children().first().get());// returned null

                    // $(this).parent().next().show();
                    // $(this).parent().next().children().first().text(InputFieldUserValue);
                    // $(this).parent().hide();
                });

2. or get the value of postResult out and compare and do the same there. The code is bellow:

 if (postResult == true) {
                $(this).parent().next().show();
                $(this).parent().next().children().first().text(InputFieldUserValue);
                $(this).parent().hide();
            }

Neither works for me. In 1 am not getting $(this) as the button ‘btnUpdateInput’ that i click and 2. the value of postResult is undefined since there is no delay so that postResult is assigned to result of post action.

Please help me out with either of the scenario.

  • 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-26T07:59:25+00:00Added an answer on May 26, 2026 at 7:59 am

    This is the element in your current IN. So in the SUCCES its in the return.

    So in method one you could do:

    $(".btnUpdateInput").click(function(e) {
    var self = e;
    //code
    alert($(self).get()); // returned Object[Object] but expected the clicked button
    alert($(self).parent().get());// returned null
    alert($(self).parent().next().get());//returned null
    alert($(self).parent().next().children().first().get());// returned null
    }
    

    Seems self is also used as default….

    Try this instead:

    $(".btnUpdateInput").click(function(e) {
    var myButton = $(this);
    //code
    alert($(myButton).get()); // returned Object[Object] but expected the clicked button
    alert($(myButton).parent().get());// returned null
    alert($(myButton).parent().next().get());//returned null
    alert($(myButton).parent().next().children().first().get());// returned null
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's share Java based web application architectures! There are lots of different architectures for
Let me share the following scenario: I have a ASP.NET intranet Web-based application that
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Hello all i have a button i am trying to let users share a
I want to let users share information on my site by sending an email
Let me share my findings before asking the question. Google Places API documentation says:
Let's say I have a script1.py with imports. How can I share script1.py imports
Well lately I'm making a script application. People can post and share stuff (let's
Edit: Let us assume the classes actually do not share an interface! Major slip
Let's say I have app on iPhone and Windows Phone 7. How to share

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.