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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:38:51+00:00 2026-06-05T06:38:51+00:00

With the following jQuery code I have created a drop down that updates the

  • 0

With the following jQuery code I have created a drop down that updates the page however I believe that when it changes #content with the returned result it is counting it as a change event and pulling the #sidebar info.

<script>
var get_pages_load_options = { 
    target:        '#content',
    data: {ajaxtype: 'content'},
    beforeSubmit:  function() {
        console.debug('beforeSubmit');
    },
    success: function() {
        console.debug('successful');
    }
};
$("#content").on('change','.get_pages',function(){
    var submit_page = $(this).attr('rel');
    var form_url = $("#"+submit_page).attr('action');
    console.debug(submit_page+" & "+form_url);
    $("#"+submit_page).ajaxForm(get_pages_load_options);
    $.ajax({
        type: "POST",
        url: form_url,
        data: {ajaxtype: "side"},
        success: function(data) {
            console.debug(data);
            $("#sidebar_menu").html(data);
        }
    });
});
</script>

The HTML is as follows for #content:

<div id="content" class="content">
    <h1>Game Updates</h1>
    <form action="/gameplay/updates/" id="submit_page" name="submit_page" class="get_pages" method="post">
        <select name="year" class="get_pages" rel="submit_page">
            <option value="2012">2012 -- v1.7.0 - v2.0.0</option>
            <option value="2011">2011 -- v1.5.3 - v1.6.0</option>
            <option value="2010">2010 -- v1.3.3 - v1.5.2</option>
            <option value="2009">2009 -- v1.1.4 - v1.3.2</option>
            <option value="2008">2008 -- v0.6.0 - v1.1.3</option>
            <option value="2007">2007 -- v0.1.x - v0.5.5</option>
        </select>
    </form>
    /** Update Logs **/
    <br/><br/>
    <p>
        -----------<br />
        Thank you,<br />
        Admin deth4uall
    </p>
</div>

Do you know how I can prevent the second firing of change. Thanks!

EDIT: I do have a regular version that is default with the above supposed to be overwriting the below functionality:

$("#content").on('change','.get_pages',function(){
    var submit_page = $(this).attr('rel');
    $("#"+submit_page).submit();
});
  • 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-05T06:38:53+00:00Added an answer on June 5, 2026 at 6:38 am

    If the values are undefined, simply return out of the function.

    $("#content").on('change','.get_pages',function(){
        var submit_page = $(this).attr('rel');
        var form_url = $("#"+submit_page).attr('action');
        if (!submit_page || !form_url) {
            return;
        }
        //console.debug(submit_page+" & "+form_url);
        $("#"+submit_page).ajaxForm(get_pages_load_options);
        $.ajax({
            type: "POST",
            url: form_url,
            data: {ajaxtype: "side"},
            success: function(data) {
                //console.debug(data);
                $("#sidebar_menu").html(data);
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery code which loads the #content div from another page,
Hallo, I have following jquery code for calling ASP.NET MVC controller method that is
I have the following bit of code. I'm trying to dynamically add drop-down options
I have the following jQuery code: $('span.readMoreReputation').mouseover(function(event) { createTooltip(event); }).mouseout(function(){ // create a hidefunction
I have the following jQuery code in a View in MVC3. I want to
I have the following Jquery code what is just 40% functional. I have couple
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jQuery code which runs when I'm clicking an option in
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if

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.