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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:21:58+00:00 2026-06-08T01:21:58+00:00

I am being forced to utilize jQuery Mobile and I have some hesitations even

  • 0

I am being forced to utilize jQuery Mobile and I have some hesitations even though it’s a very well-constructed system. So, I have a form that submits when any of the checkboxes change. The client wants it so that when they click one the page waits to submit for a set time so if another one is selected the previous request does not get fired and the new one does. It’s essentially to make it less instantaneous and allow for more efficient filtering/requests. My code is like so:

$( function() {

    var sForm = "form[name='Waves']",
        sCboxes = "input[type='checkbox']",
        sWaves = "";

    var $Cboxes = $(sForm + " " + sCboxes),
        sChecked = sCboxes + ":checked";

    $Cboxes.change( function(event) {

        var $this = $(this);

        if ( $this.attr("id") != "ClearAll" ) {

            console.debug($(this));

            console.debug('Changing page.');

            sWaves = "";

            // Form the string for the selected waves with standard check-if-it's-the-last
            // element logic for comma generation.

            $.each( $(sChecked) , function(i, v) {

                var $this = $(this);

                var iIndex = v.value;

                sWaves += iIndex + ( ( i == $(sChecked).length - 1 ) ? "" : "," );

            } );

            console.debug("Waves to select: " + sWaves);

            $.mobile.changePage("default.asp", {

                data: { Wave: sWaves },     // Submit the previously formed string

                type: "post"

            } );

            //$(sForm).submit();

        } else {

            $(sChecked).add( $(this) ).attr("checked", false).checkboxradio("refresh");

            $.mobile.changePage("default.asp", {

                data: { Wave: "" },

                type: "post"

            } );

        }

    } );

    $("#ClearAll").click( function(event) {

        event.preventDefault();

    } );

    $(".slideout").click( function(){

        $(this).parents(".ui-collapsible").find(".ui-icon-minus").click();

    } );

} );

The HTML for the form:

<form ACTION="<%=ASP_SELF()%>" ID="Waves" METHOD="post" NAME="Waves">

<% ' Put the scripts we need here so that it loads with the page. %>
<script SRC="/base/scripts/scripts.js"></script>

<fieldset DATA-ROLE="controlgroup" DATA-TYPE="horizontal" STYLE="margin-left:5px; margin-bottom:0px; ">
       <input TYPE="checkbox" NAME="#" ID="#" VALUE="Select Waves" CLASS="custom"   />
       <label CLASS="no-hover" FOR="#">&nbsp;Waves:&nbsp;</label>
       <input TYPE="checkbox" NAME="Wave1" ID="Wave1" VALUE="1" CLASS="custom" STYLE="width:70px !important; " <% If Instr(request("Wave"),"1") OR WaveOne = "YES" Then response.write " checked=""checked""" End If %> />
       <label FOR="Wave1">&nbsp;1&nbsp;</label>
       <input TYPE="checkbox" NAME="Wave2" ID="Wave2" VALUE="2" CLASS="custom" STYLE="width:70px !important; " <% If Instr(request("Wave"),"2") OR WaveTwo = "YES" Then response.write " checked=""checked""" End If %> />
       <label FOR="Wave2">&nbsp;2&nbsp;</label>
       <input TYPE="checkbox" NAME="Wave3" ID="Wave3" VALUE="3" CLASS="custom" STYLE="width:70px !important; "<% If Instr(request("Wave"),"3") OR WaveThree = "YES" Then response.write " checked=""checked""" End If %> />
       <label FOR="Wave3">&nbsp;3&nbsp;</label>
       <input TYPE="checkbox" NAME="Wave4" ID="Wave4" VALUE="4" CLASS="custom" STYLE="width:70px !important; "<% If Instr(request("Wave"),"4") OR WaveFour = "YES" Then response.write " checked=""checked""" End If %> />
       <label FOR="Wave4">&nbsp;4&nbsp;</label>

       <input TYPE="checkbox" NAME="ClearAll" ID="ClearAll" VALUE="Clear" CLASS="custom" $('input[data-type="search"]').TRIGGER("CHANGE").VAL(""); />
       <label FOR="ClearAll">&nbsp;Clear&nbsp;&nbsp;</label>
</fieldset>
    </form>

I need to delay the $.mobile.changePage call just long enough to allow for the other related checkboxes (within the same fieldset) to be toggled as well. I appreciate any input! It’s a very important matter.

  • 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-08T01:22:00+00:00Added an answer on June 8, 2026 at 1:22 am
    var timer;
    var waitTime = 2000;
    $Cboxes.change( function(event) {
    
     if(timer)clearTimeout(timer);
    
     timer = setTimeout(function(){
      //your logic
      },waitTime);
    
     });
    

    When change event is fired the action to be performed is scheduled to go after 2000ms,
    If user changes mind befor e that just clear the interval and make a new one

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

Sidebar

Related Questions

Being forced from NPOI to microsoft interop, I have to perform a task of
I have the great joy of being forced to import data from an old
I'm trying to write a contact form however my label widths aren't being forced
Due to some restrictions I am being forced to load a library written in
I'm being forced to connect to some .net service in a VBA tool I'm
Coming from a VB background and being forced to learn C# I have hit
Being a Java developer in an agile development cycle, I have learnt that it
I'm being forced/payed to work on a Legacy ColdFusion project (I'm an usual C#
I have a feeling I'm missing something obvious, but... All my neat jQuery functions
I have few Vaadin tabs one of them is displaying an table and some

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.