• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Open a popup box after receiving result from ajax

javascriptphpjqueryajaxpopup


PHP Snippet 1:

success: function (returndata) {
    if (returndata[4] === 1) {
        $('#bsModal3').modal(); // this
    } else {
        // other code
    }
},

PHP Snippet 2:

$.ajax({
        type: 'post',
        url: 'test2.php',
        dataType: 'json',
        data: {
            txt: txtbox,
            hidden: hiddenTxt
        },
        cache: false,
        success: function (returndata) {
            if (returndata[4] === 1) {
               $('#bsModal3').modal();  // Please right this in your Code
            } else {
                // other code
            }
        },
        error: function () {
            console.error('Failed to process ajax !');
        }
    });

Related Snippets

Component install error: JInstaller: :Install: File does not exist

How to show selected value using javascript in laravel

nginx err_connection_refused, can anyone help me?

onKeyUp event calculation not working on the following rows from php generated forms except the first one

How to separate letters and digits from a string in php

Yii2 redirecting to previous page after login

Saving Data from form to database using AngularJS and php

Toggle between a textbox and a select using PHP

Chunk and transpose a flat array into rows with a specific number of columns

how to remove %20 in the url in php

Parameter is not sent to Laravel route in Ajax

Problem with fetching data from database in Laravel

How can I make a full text index of the column?

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

woocommerce change position of price

About Contact Privacy policy Terms and conditions