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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:43:09+00:00 2026-05-18T03:43:09+00:00

I am submitting an AjaxForm with the help of javascript triggered by change event

  • 0

I am submitting an AjaxForm with the help of javascript triggered by change event of this dropdownlist and update the div (that contains ddlist too) accordingly.

  $(function() {
            $('#Page').change(function() {
                alert("testing");
                var value = $(this).val();
                if (value != "<%=Model.CurrentPage%>") {
                    $("#pageJump").click();
                }
            });
        }); 

    <div id = "updateDiv">

    <%=Html.DropDownList("Page", Model.dropDown)%>

</div>

updateDiv is being updated by some Ajax stuff. DropDownList is correctly populating the items, but it fires the above javascript thing only once(after it has been posted once), not the second time. Why is it doing that?

EDIT:

 $(function() {
        initPaging();
    });

    function initPaging() {
        alert("TEST");
        initPagingDdl();
    }

    function initPagingDdl() {
        $('#Page').change(function() {
            alert("all");
            var value = $(this).val();
            alert(value);
            if (value != "<%=Model.CurrentPage%>") {
                $("#pageJump").click();
            }
        });
}

Inside my AjaxOptions constructor, I have set:

OnComplete = "initPaging"

It is still NOT working. It’s calling the TEST after the Ajax post, so it’s hitting the code, but not binding for some reason?

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

    Whenever you update content of your updateDiv using AJAX, DOM refreshes each time. I’m not much sure, but it unbinds all events associated with its child. Hence your function is getting executed once only.

    You can use either

    1. Binding of click event in callback method of your ajax call OR
    2. bind click event to

      $(‘#updateDiv select’).change(function() {
      }); // not sure may work

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

Sidebar

Related Questions

I have a form that contains a bunch of checkboxes. Before submitting the form,
I am submitting a ColdFusion Form and I want to run some JavaScript to
Does anyone know the official method for submitting feedback on C# 4.0 so that
I am submitting a form via jquery form submit. just like this example However,
The aim is to show a form which will update the div on the
I'm submitting a parameter show_all with the value true . This value isn't associated
I have written this ajaxform function with a success function which is being called
I have a fancybox that loads a form that collects user input. In this
I am submitting a job using qsub that runs parallelized R. My intention is
When submitting an app to the app store what is the real difference between

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.