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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:27:01+00:00 2026-05-24T17:27:01+00:00

I am using jQuery dialog plugin because i need to make decision upon user

  • 0

I am using jQuery dialog plugin because i need to make decision upon user click

here is my code

  <script type='text/javascript'>


  $(function() {
    //destroying dialog


    $('#rdy').tipsy();
    $('#flt').tipsy();
    $('#num').tipsy();
    $('#tpe').tipsy();
    $('#reg').tipsy();
    $('#etd').tipsy();
    $('#dla').tipsy();
    $('#dp').tipsy();
    $('#rem').tipsy();
    $('#to').tipsy();   
    $('#eta').tipsy();
    $('#arr').tipsy();
 });
    $(function(){
        var fDep=document.forms.fDep;
        var flt=fDep.elements['flt[]'];
        var num=fDep.elements['num[]'];     
        var reg=fDep.elements['reg[]'];
        var etd=fDep.elements['etd[]'];
        var dla=fDep.elements['dla[]'];     
        var dep=fDep.elements['dep[]'];     
        var eta=fDep.elements['eta[]'];     
        var arr=fDep.elements['arr[]'];
        for (var i=0;i<flt.length;i++){
            //var aCtrl=ctrls[i];
            //window.alert(etd[i].value);
            $(flt[i]).mask("aa?a");
        }
        for (var i=0;i<num.length;i++){
            //var aCtrl=ctrls[i];
            //window.alert(etd[i].value);
            $(num[i]).mask("99?999");
        }
        for (var i=0;i<etd.length;i++){
            //var aCtrl=ctrls[i];
            //window.alert(etd[i].value);
            $(etd[i]).mask("99:99");
        }
        for (var i=0;i<dla.length;i++){
            $(dla[i]).mask("99:99");
        }
        for (var i=0;i<dep.length;i++){
            $(dep[i]).mask("99:99");
        }
        for (var i=0;i<eta.length;i++){
            $(eta[i]).mask("99:99");
        }
        for (var i=0;i<arr.length;i++){
            $(arr[i]).mask("99:99");
        }

        for (var i=0;i<reg.length;i++){
            $(reg[i]).mask("99?9999");
            //$(reg[i]).css("color","#ff00ff");
        }

    });

    $(".edit_tr").change(function(){

        //window.alert($(this).attr('id')); 
        var rowID=$(this).attr('id');
        //window.alert($("#dep" + rowID).val());

        var sendReq;

        var flt=$("#flt"+rowID).val();
        var num=$("#num"+rowID).val();
        var tpe=$("#tpe"+rowID +" option:selected").val();
        var reg=$("#reg"+rowID).val();
        var etd=$("#etd"+rowID).val();
        var dla=$("#dla"+rowID).val();
        var dep=$("#dep"+rowID).val();
        var rem=$("#rem"+rowID).val();
        var city=$("#city"+rowID +" option:selected").val();
        var eta=$("#eta"+rowID).val();
        var arr=$("#arr"+rowID).val();
        //window.alert();
        var dataStr="flt="+flt+"&"
                    +"num="+num+"&"
                    +"tpe="+tpe+"&"
                    +"reg="+reg+"&"
                    +"etd="+etd+"&"
                    +"dla="+dla+"&"
                    +"dep="+dep+"&"
                    +"rem="+rem+"&"
                    +"city="+city+"&"
                    +"eta="+eta+"&"
                    +"arr="+arr;
        //window.alert(dataStr);

        $("#dialog-confirm" ).dialog({
        resizable: false,
        height:140,
        modal: true,
        buttons: {
            "Сохранить": function() {

                $("#ico"+rowID).html("<img src='images/indic.gif' />");
                $( this ).dialog( "close" );
                sendReq=true;
            },
            "Отмена": function() {
                $("#ico"+rowID).html("");
                $( this ).dialog( "close" );
            }
        }
        });     


        if (sendReq==true){
            $.ajax({
                type: "POST",
                url: "updFlt.php",
                data: dataStr,
                cashe: false,
                success: function(html){
                    $("#ico"+rowID).html("");
                    window.alert("It's ok");
                }
            });
        }else
        {
            window.alert("false");  
        }

        });





</script>

that’s I have dialog popup that has 2 buttons when user clicks the first button I need to send data using ajax else cancel…

  $("#dialog-confirm" ).dialog({
        resizable: false,
        height:140,
        modal: true,
        buttons: {
            "Сохранить": function() {

                $("#ico"+rowID).html("<img src='images/indic.gif' />");
                $( this ).dialog( "close" );
                sendReq=true;
            },
            "Отмена": function() {
                $("#ico"+rowID).html("");
                $( this ).dialog( "close" );
            }
        }
        });

after that i do checking and send to server using ajax

    if (sendReq==true){
        $.ajax({
            type: "POST",
            url: "updFlt.php",
            data: dataStr,
            cashe: false,
            success: function(html){
                $("#ico"+rowID).html("");
                window.alert("It's ok");
            }
        });
    }else
    {
        window.alert("false");  
    }

    });

The result which I’m getting is that window.alert("false"); -this line of code gets executed before jQuery dialog popup!! Why it is so??? When I run my web app and change table row standard alert pops up first(modal form) then I reach confirm-dialog
$(“#dialog-confirm” ).dialog() popup though this line of code precedes standard alert call !!!

  • 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-24T17:27:02+00:00Added an answer on May 24, 2026 at 5:27 pm

    change the code to this:

    $("#dialog-confirm" ).dialog({
            resizable: false,
            height:140,
            modal: true,
            buttons: {
                "Сохранить": function() {
    
                    $("#ico"+rowID).html("<img src='images/indic.gif' />");
                    $( this ).dialog( "close" );
                    $.ajax({
                    type: "POST",
                    url: "updFlt.php",
                    data: dataStr,
                    cashe: false,
                    success: function(html){
                        $("#ico"+rowID).html("");
                        window.alert("It's ok");
                    }
                });
                },
                "Отмена": function() {
                    $("#ico"+rowID).html("");
                    $( this ).dialog( "close" );
                }
            }
            });    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is what I have..I am using the jquery.FrameDialog plugin. When the dialog box
I am using the jquery-ui-dialog plugin I am looking for way to refresh the
Using jQuery's dialog I came across the following quirk (tested in FF3): User selects
I am using the following code to show a jQuery UI dialog when the
Scenario: Using jquery form plugin . The form appears in a dialog, created with
I am using Jquery UI Dialog box with FullCalendar plugin. My problem is UI
i'm using ajax form jquery plugin to submit a form (in a dialog) via
I'm currently using the confirmaction jQuery plugin found here: http://www.webstuffshare.com/2010/03/jquery-plugin-jconfirmaction/ And my question is
All, I am using the JQuery Autocomplete Plugin 1.0.2 in a JQuery UI Dialog.
Using jquery alerts dialog plugin , how do I send a value in a

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.