• 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

Send same name multiple checkbox values via ajax

javascriptphpjqueryajax


PHP Snippet 1:

var checked = [];
$("input[name='userpages[]']:checked").each(function ()
{
    checked.push(parseInt($(this).val()));
});

PHP Snippet 2:

var data = []

$('input[name="userpages[]"').each (function (index, element) {
    data[$(element).attr('id')] = $(element).val();
});
console.log(data);

Related Snippets

generate an Excel file using PHP

Laravel MSSQL Server Connection not working

Reorder attribute dropdown terms in Woocommerce single variable products

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Session timeout in Yii2

How to to send mail using gmail in Laravel?

How to redirect to another page and call a Function there on Angular ng-click

How to add a sidebar to Woocommerce Shop Page?

Clients authentication and user authentication with laravel

Inserting Country Selection into MySQL PHP [duplicate]

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

Display a success custom notice after Placing an Order in WooCommerce

Pages are working fine on localhost but not running on the hosting server

PHP drop down list using array's and foreach (else and for) code

Get WooCommerce products from specific category

About Contact Privacy policy Terms and conditions