• 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

I want to display a sweetalert after the inserting of data in my database

How to show selected value using javascript in laravel

Laravel You requested 1 items, but there are only 0 items available

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

get data-value with variable value

get data-value with variable value

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Dynamic dropdown Ajax PHP request

PHP sort array of objects by two properties

Display a success custom notice after Placing an Order in WooCommerce

How can I create a Download Page with post php method?

php retrieve specific data onclick from database in a list format

Login if user is active using Laravel Breeze

Laravel csrf token mismatch for ajax POST Request

How to Generate PDF invoice to XML format using mPDF

About Contact Privacy policy Terms and conditions