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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:10:02+00:00 2026-05-20T03:10:02+00:00

So I have a JavaScript method that is ran after a user selects certain

  • 0

So I have a JavaScript method that is ran after a user selects certain check-boxes. This method makes one AJAX call to render a “header” view, and then makes an AJAX call for each of the selected check-boxes, and then appends those views as well.

The issue is that when I’m looping through the check-boxes with JQuery and making an AJAX call for each of them, it’s just making a bunch of AJAX calls one after the other in the right order, but they get rendered at different times depending on how long each one takes. I guess this is the beauty of AJAX, but I need it to render in the order I call them for this specific task.

Here is the method:

function GenerateTermSheet()
{
    var urlString = "<%= System.Web.VirtualPathUtility.ToAbsolute("~/mvc/Indications.cfc/RenderPartialTermSheetView")%>";
    var jsonNickname = 
    {
        id : GetGUIDValue(),
        viewName : 'Nickname'
    }
    $.ajax({
        type: "POST",
        url: urlString,
        data: jsonNickname,
        success: function(data) {
            $('#termSheetPrinted').append(data);
        }
    });
    $('#termSheetPopup input[type="checkbox"]:checked').each(function(){
        var checkedName = $(this).attr("name");
        var json = 
        {
            id : GetGUIDValue(),
            viewName : checkedName
        }
        $.ajax({
            type: "POST",
            url: urlString,
            data: json,
            success: function(data) {
                $('#termSheetPrinted').append(data);
            }
        });
    })
    $('#termSheetPopup').dialog('close');
    $('#termSheetPrinted').dialog('open');
}

Know how I can do this? Thanks!

  • 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-20T03:10:03+00:00Added an answer on May 20, 2026 at 3:10 am

    I would suggest placing the second AJAX call within a function that is called in the success function of the call that must be completed first. This will cause the second call to only execute if the first was successful, and will achieve the goal you were seeking.

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

Sidebar

Related Questions

I have a JavaScript method that I need to run on one of my
I have a native Javascript method in one of my GWT Java classes, but
I have a JavaScript method that i want to validate a form if the
i have a javascript method that takes a date: convert(new Date(02/20/2010); how can i
I have a JavaScript method that call JQuery.get() and i want to return value
I'm creating my own JavaScript Array-like object and I have methods that call closures.
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
I have several update methods in a javascript file, used for updating my ajax
I have a javascript function that manipulates the DOM when it is called (adds
I have a JavaScript widget which provides standard extension points. One of them is

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.