• 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

Transpose csv file data [duplicate]

How to insert data from multiple select dropdown values into database?

How to convert a carbon into string, to take the date only?

How do I call Validator from a namespace with an already existing Validator class

Get lat/lon from google maps url ftid (hex)

How to make autocomplete work in foreach php loop? (vscode, intellisense)

hidden INPUT value not available in $_POST

Laravel 5 session not persisting after user is logged in

How to give apache permission to write to home directory?

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

how to upload binary image to sql server using php laravel

Respond with status code 401 on authentication failure using Laravel and Passport?

PHP Get value from JSON [duplicate]

Navigation idle on content download

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

About Contact Privacy policy Terms and conditions