Topic: Ajax

jQuery Multiple Email Address Validation in one text box 0

jQuery Multiple Email Address Validation in one text box with comma

Today, We want to share with you jQuery Multiple Email Address Validation in one text box with comma.In this post we will show you Validate multiple email addresses in single input text example, hear for Email address validation in jQuery using Regular Expressions we will give you demo and example for implement.In this post, we will learn about How to validate multiple email addresses entered into a textbox. Using Java Script or JQuery? with an example.

jQuery Multiple Email Address Validation in one text box with comma

There are the Following The simple About jQuery Multiple Email Address Validation in one text box with comma Full Information With Example and source code.

As I will cover this Post with live Working example to develop jQuery validation plugin multiple email addresses, so the Validate multiple emails with JavaScript for this example is following below.

Example 1: Email address validation in jQuery using Regular Expressions

Step 1: include jQuery validate file and Javascript files from CDN

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>

Step 2: HTML Form index.html File

<div class="form-group">
    <label for="email" class="col-lg-2 control-label">Email: </label>
    <div class="col-lg-10">
        <input class="form-control" type="text" id="email" name="email" autocomplete="off" placeholder="Enter Your Email">
    </div>
</div>

Step 3: javascript/jQuery Source code

$.validator.addMethod('multipleemailaddress', function(value, element, param) {
        if (this.optional(element)) // return true on optional element
             return true;
         var emails = value.split(/[;,]+/); // split element by , and ;
         valid = true;
         for (var i in emails) {
             value = emails[i];
             valid = valid &&
                     jQuery.validator.methods.email.call(this, $.trim(value), element);
         }
         return valid;
});


$("#form").validate({
    rules: {
        email : {
            required: true,
            multipleemailaddress: true
        }
    },
    messages: {
        email: {
            required: "Enter Your email.",
            multipleemailaddress: "You must enter a valid e-mail address."
        }
    },
    submitHandler: function(form) {
         $("#loading").show();
    }
});

Example 2: Validate multiple email id’s using jQuery

Step 1: HTML Form index.html File

<form id="form" method="post">
List Of Your Friends Email Address :<input type="text" name="emails" id="emails" class="emails"><br />
<input type="submit" value="Virat Kohali">
</form>

Step 2: javascript/jQuery Source code

jQuery.validator.addMethod(
    "multipleemailaddress",
     function(value, element) {
         if (this.optional(element))
             return true;
         var emails = value.split(/[;,]+/);
         valid = true;
         for (var i in emails) {
             value = emails[i];
             valid = valid &&
                     jQuery.validator.methods.email.call(this, $.trim(value), element);
         }
         return valid;
     },

   jQuery.validator.messages.multipleemailaddress
);

$("#form").validate({
    rules: {
        emails: { required: true, multipleemailaddress: true }
    },
    messages: {
        emails: {
                required: "Please Enter Your Valid email.",
                multipleemailaddress: "You must enter a valid e-mail address.."
            }
        }
});

Demo : jQuery validation plugin multiple email addresses

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Multiple Email Address Validation in one text box with comma.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP Laravel Datatable Server Side Processing using jQuery 0

PHP Laravel Datatable Server Side Processing using jQuery Ajax

Today, We want to share with you PHP Laravel Datatable Server Side Processing using jQuery Ajax.In this post we will show you Datatables Server Side Processing in Laravel 5.7, hear for datatables Laravel server-side processing in codeigniter using ajax we will give you demo and example for implement.In this post, we will learn about jQuery Datatable Server Side Processing With Custom Operations using Laravel with an example.

PHP Laravel Datatable Server Side Processing using jQuery Ajax

There are the Following The simple About PHP Laravel Datatable Server Side Processing using jQuery Ajax Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel server side processing for Datatables, so the laravel 5.7 datatables package for this example is following below.

Step 1: include Datatables CSS file and Javascript files from CDN

<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script type="text/javascript" language="javascript" src="http://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>

Step 2: HTML table in Laravel Blade File

Here are the steps to be followed for Implement datatables server side processing Laravel

Let the Laravel blade view page be datatable.blade.php. Your HTML Data table columns may be all the different but the step by step (laravel datatables tutorial) here.

<h3>List of The All Articles Title</h3>
<table class="table table-bordered" id="article_datatables">
    <thead>
           <th>Id</th>
           <th>Title</th>
           <th>Action</th>
          
    </thead>                
</table>

Step 3: javascript Source code

And then call simple Laravel Ajax using javascript source code given below. This ajax will automatically call action when you load your page.Below we can ajax request source code. Put this laravel datatables ajax source code to your Laravel blade view page of laravel at the bottom with laravel datatables pagination.

<script>
    $(document).ready(function () {
        $('#article_datatables').DataTable({
            "processing": true,
            "serverSide": true,
            "ajax":{
                     "url": "/fetch_all_articles’",
                     "dataType": "json",
                     "type": "POST",
                     "data":{ _token: "{{csrf_token()}}"}
                   },
            "columns": [
                { "data": "id" },
                { "data": "title" },
                { "data": "action" }
            ]    

        });
    });
</script>

Step 4: Laravel Define Route

Put Laravel Route in your web.php files

And then we want set Laravel route for this method, so we have to go to routes/web.php file and write following source code for set route for index method.

Route::post(‘/fetch_all_articles’,’[email protected])

Step 5: Source code for fetchAllArticles function in ArticleController

jQuery Live Server side Datatable for pagination, records and search filters in laravel datatable server side.

 public function fetchAllArticles(Request $request)
    {

        $columns = array(
            0 => 'id',
            1 => 'title',
        );
        $totalTitles = Article::where('deleted_at', '=', null)
            ->count();
        $totalFiltered = $totalTitles;

        $limit = $request->input('length');
        $start = $request->input('start');
        $order = $columns[$request->input('order.0.column')];
        $page_dir = $request->input('order.0.dir');

        if (empty($request->input('search.value'))) {
            $titles = Article::where('deleted_at', '=', null)
                ->offset($start)
                ->limit($limit)
                ->orderBy($order, $page_dir)
                ->get();
        } else {
            $string_search = $request->input('search.value');

            $titles = Article::where('title', 'LIKE', "%{$string_search}%")
                ->where('deleted_at', '=', null)
                ->offset($start)
                ->limit($limit)
                ->orderBy($order, $page_dir)
                ->get();

            $totalFiltered = Article::where('title', 'LIKE', "%{$string_search}%")
                ->where('deleted_at', '=', null)
                ->count();
        }

        $all_products_data = array();
        if (!empty($titles)) {
            $count = 1;
            foreach ($titles as $title) {

                $nestedData['id'] = $count;
                $nestedData['title'] = $titles->title;
                $nestedData['action'] = '<button type="button" class="btn btn-success" onclick="" title="Edit">
                                        </button>
                                        <button type="button" style="margin-left:6px;" class="btn btn-success" onclick="" title="Article Delete">
                                        </button>';
                $all_products_data[] = $nestedData;
                $count++;
            }
        }

        $product_data = array(
            "draw" => intval($request->input('draw')),
            "recordsTotal" => intval($totalTitles),
            "recordsFiltered" => intval($totalFiltered),
            "data" => $all_products_data,
        );
        echo json_encode($product_data);
 }

Code Understanding

$request – In this case by default all datatables parameters are gets that are sent by jquery ajax serever side datatable.

$totalTitles – totalTitles are the sum all thr count that will be used for Ajax call jquery Datatables pagination in your Laravel Serverside datatable.

$limit – page data record limit is the set variable that init mode number of data records to be get at a time. ( No of total data records to display on page one )

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Laravel Datatable Server Side Processing using jQuery Ajax.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

jQuery Multiple Class Selectors Match Examples 0

jQuery Multiple Class Selectors Match

Today, We want to share with you jQuery Multiple Class Selectors Match.In this post we will show you Jquery matching multiple elements with same id/class, hear for jquery select multiple elements with same class we will give you demo and example for implement.In this post, we will learn about Select an Element with Multiple Classes with jQuery with an example.

jQuery Multiple Class Selectors Match

There are the Following The simple About jQuery Multiple Class Selectors Match Full Information With Example and source code.

As I will cover this Post with live Working example to develop Multiple Selector (“selector1, selector2, selectorN”), so the select only one div among divs with same css class for this example is following below.

jQuery multiple classes Selector

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".card, .base, .save").css("background-color", "green");
  $(".card, .base, .save").css("color", "white");
  $(".card, .base, .save").css("padding", "5px");
});
</script>
</head>
<body>

<h1>Welcome to My www.pakainfo.com</h1>

<p class="card">jquery select multiple elements with same class "intro".</p>
<p>This is a paragraph.</p>
<p class="base">jquery multiple attribute selectors "demo".</p>
<p>jquery same click event for multiple elements.</p>
<p class="save">jquery multiple selectors on click "end".</p>

</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Related Keywords : jquery multiple attribute selectors, jquery multiple selectors on click, jquery select multiple elements with same class, jquery class selector, css multiple class selector, jquery same click event for multiple elements, jquery selector match two classes, jquery eq multiple elements, jQuery multiple classes Selector, Multiple Selector (“selector1, selector2, selectorN”), Select an Element with Multiple Classes with jQuery, jquery select multiple elements with same class, Jquery matching multiple elements with same id or class, jQuery Multiple Class Selectors Match

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Multiple Class Selectors Match.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

DropZone Allowed File Extensions Tutorials 0

DropZone Allowed File Extensions Tutorials

Today, We want to share with you DropZone Allowed File Extensions Tutorials.In this post we will show you dropzone.js image upload acceptedMimeTypes, hear for Accepted File Formats for Uploads in DropZone.js we will give you demo and example for implement.In this post, we will learn about How to Upload Additional File Types in DropZone.js with an example.

DropZone Allowed File Extensions Tutorials

There are the Following The simple About DropZone Allowed File Extensions Tutorials Full Information With Example and source code.

As I will cover this Post with live Working example to develop DropZone acceptedFiles type filter, so the some DropZone Accepted File Formats for Uploads for this example is following below.

Allowed File Types of DropZone.js File Upload Plugin

acceptedFiles: ".jpeg,.jpg,.png,.gif",

//all images uploded
acceptedFiles: "image/*",

Dropzone.js allowed file types

Valid acceptedFiles properties

audio/*
image/*
image/jpeg,
image/png

//acceptedMimeTypes
"audio/*,image/*,.psd,.pdf"

//dropzone.js example with restriction
acceptedFiles: ".png,.jpg,.gif,.bmp,.jpeg",

Changing Allowed File Types in DropZone

acceptedFiles: "image/jpeg,image/png,image/gif"

Allowed File Extensions

//Documents
pdf, doc, docx, xls, xlsx, csv, txt, rtf, html, zip, 

//Audio & Video
mp3, wma, mpg, flv, avi, 

//Images
jpg, jpeg, png, gif

Supported file formats in Dropzone

DropZone.js Accepted file types and sizes

Dropzone.options.fileupload = {
  acceptedFiles: "image/jpeg, image/png, image/jpg"
}

Accepted File Formats for Uploads in DropZone.js

Type an asterisk * to allow all file types.

maxFiles: 5,
maxFilesize: 20,
acceptedFiles: "image/*,application/pdf,.doc,.docx,.xls,.xlsx,.csv,.tsv,.ppt,.pptx,.pages,.odt,.rtf",

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

Related Keywords: DropZone Accepted File Formats for Uploads, DropZone acceptedFiles type filter, dropzone.js image upload acceptedMimeTypes, Accepted File Formats for Uploads in DropZone.js, How to Upload Additional File Types in DropZone.js

I hope you get an idea about DropZone Allowed File Extensions Tutorials.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel AJAX Live Search Example 0

Laravel AJAX Live Search Example

Today, We want to share with you Laravel AJAX Live Search Example.In this post we will show you Laravel 5.6 – Dynamic Ajax Autocomplete Search Box, hear for Create Live Search In Laravel Using AJAX we will give you demo and example for implement.In this post, we will learn about Ajax Live Search Table Generation in Laravel with an example.

Laravel AJAX Live Search Example

There are the Following The simple About Laravel AJAX Live Search Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel Typeahead Search Tutorial With Example, so the Fetch records from MySQL with jQuery AJAX – Laravel for this example is following below.

Define the Laravel Routes

<?php
Route::get('/live_search', '[email protected]');
Route::get('/live_search/action', '[email protected]')->name('live_search.action');
?>

Create a Laravel Blade file View

resources/views/live_search.blade.php

<!DOCTYPE html>
<html>
 <head>
  <title>Live search in laravel using AJAX - Pakainfo.com</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
 </head>
 <body>
  <br />
  <div class="container box pakainfo">
   <h3 align="center">Live search in laravel using AJAX - Pakainfo.com</h3><br />
   <div class="panel panel-success pakainfo">
    <div class="panel-heading pakainfo">Search Member Data</div>
    <div class="panel-body pakainfo">
     <div class="form-group pakainfo">
      <input type="text" name="search" id="search" class="form-control" placeholder="Search Member Data" />
     </div>
     <div class="table-responsive pakainfo">
      <h3 align="center">Total Member Data : <span id="total_records"></span></h3>
      <table class="pakainfo table table-striped table-bordered">
       <thead>
        <tr>
         <th>Member Name</th>
         <th>RecAddress</th>
         <th>Country</th>
         <th>Postal Code</th>
         <th>Area</th>
        </tr>
       </thead>
       <tbody>

       </tbody>
      </table>
     </div>
    </div>    
   </div>
  </div>

  <script>
$(document).ready(function(){

 fetch_customer_data();

 function fetch_customer_data(query = '')
 {
  $.ajax({
   url:"{{ route('live_search.action') }}",
   method:'GET',
   data:{query:query},
   dataType:'json',
   success:function(data)
   {
    $('tbody').html(data.table_data);
    $('#total_records').text(data.total_data);
   }
  })
 }

 $(document).on('keyup', '#search', function(){
  var query = $(this).val();
  fetch_customer_data(query);
 });
});
</script>

 </body>
</html>

Create the Controller using PHP artisan

php artisan make:controller LiveSearch

Laravel Create Controller

app/Http/controller/LiveSearch.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;

class LiveSearch extends Controller
{
    function index()
    {
     return view('live_search');
    }

    function action(Request $request)
    {
     if($request->ajax())
     {
      $output = '';
      $query = $request->get('query');
      if($query != '')
      {
       $data = DB::table('tbl_customer')
         ->where('MemberName', 'like', '%'.$query.'%')
         ->orWhere('RecAddress', 'like', '%'.$query.'%')
         ->orWhere('Country', 'like', '%'.$query.'%')
         ->orWhere('ZipCode', 'like', '%'.$query.'%')
         ->orWhere('Area', 'like', '%'.$query.'%')
         ->orderBy('MemberId', 'desc')
         ->get();
         
      }
      else
      {
       $data = DB::table('tbl_customer')
         ->orderBy('MemberId', 'desc')
         ->get();
      }
      $total_row = $data->count();
      if($total_row > 0)
      {
       foreach($data as $datarow)
       {
        $output .= '
        <tr>
         <td>'.$datarow->MemberName.'</td>
         <td>'.$datarow->RecAddress.'</td>
         <td>'.$datarow->Country.'</td>
         <td>'.$datarow->ZipCode.'</td>
         <td>'.$datarow->Area.'</td>
        </tr>
        ';
       }
      }
      else
      {
       $output = '
       <tr>
        <td align="center" colspan="5">No Any Member Data Found</td>
       </tr>
       ';
      }
      $data = array(
       'table_data'  => $output,
       'total_data'  => $total_row
      );

      echo json_encode($data);
     }
    }
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel AJAX Live Search Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

jQuery Ajax Calling Laravel Example From Scratch 0

jQuery Ajax Calling Laravel Example From Scratch

Today, We want to share with you jQuery Ajax Calling Laravel Example From Scratch.In this post we will show you Laravel Ajax Call to a function in controller, hear for JQuery Ajax Post Request Example in Laravel 5.7 we will give you demo and example for implement.In this post, we will learn about Laravel 5.7 Jquery Ajax Request Example From Scratch with an example.

jQuery Ajax Calling Laravel Example From Scratch

There are the Following The simple About jQuery Ajax Calling Laravel Example From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop AJAX call to a Laravel controller function / method, so the laravel 5.7 ajax post to controller for this example is following below.

Laravel pass data to a controller using Ajax

 $.ajax({
    method: 'POST',
    url: '/httpajaxRequest',
    dataType: 'json'
    data: {
        productID: 0124570,
        productName: 'Bonding Gift'
     },
})

Add Laravel Blade File:

resources/views/httpajaxRequest.blade.php

<!DOCTYPE html>
<html>
<head>
    <title>Pakainfo.com - Laravel 5.7 jQuery Ajax  Request example</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
    <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<body>
    <div class="container">
        <h1>Laravel 5.7 jQuery Ajax  Request example</h1>
        <b>Laravel Ajax Call to a function in controller</b>
        <form >
            <div class="form-group">
                <label>Member Name:</label>
                <input type="text" name="name" class="form-control" placeholder="Member Name" required="">
            </div>
            <div class="form-group">
                <label>Member Password:</label>
                <input type="password" name="password" class="form-control" placeholder="Member Password" required="">
            </div>
            <div class="form-group">
                <strong>Member Email:</strong>
                <input type="email" name="email" class="form-control" placeholder="Member Email" required="">
            </div>
            <div class="form-group">
                <button class="btn btn-success btn-data-post">Submit</button>
            </div>
        </form>
    </div>
</body>
<script type="text/javascript">
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    $(".btn-data-post").click(function(e){
        e.preventDefault();
        var name = $("input[name=name]").val();
        var password = $("input[name=password]").val();
        var email = $("input[name=email]").val();
        $.ajax({
           type:'POST',
           url:'/httpajaxRequest',
           data:{name:name, password:password, email:email},
           success:function(data){
              alert(data.success);
           }
        });
    });
</script>
</html>

Add Controller methods:

Creating an AJAX call to a Laravel controller function / method

app/Http/Controllers/ProductController.php

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ProductController extends Controller
{
    public function httpajaxRequest()
    {
        return view('httpajaxRequest');
    }
    public function ajaxRequestPost()
    {
        $input = request()->all();
        return response()->json(['success'=>'Got Simple jQuery Ajax Http Request.']);
    }
}

Add Routes for Ajax Request:

routes/web.php

JQuery Ajax Post Request Example in Laravel 5.7 Routing

Laravel 5.7 jQuery Ajax GET and POST examples

Route::get('httpajaxRequest', '[email protected]');
Route::post('httpajaxRequest', '[email protected]');

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Ajax Calling Laravel Example From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

jQuery Enable Disable Submit Button Example 0

jQuery Enable Disable Submit Button Example

Today, We want to share with you jQuery Enable Disable Submit Button Example.In this post we will show you How to enable and disable submit button using jQuery, hear for jQuery – How to disabled submit button after clicked we will give you demo and example for implement.In this post, we will learn about Disable or Enable Submit Button using jQuery .prop() Method with an example.

jQuery Enable Disable Submit Button Example

There are the Following The simple About jQuery Enable Disable Submit Button Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop Enable Disable Submit Button using jQuery, so the some how to enable and disable submit button in php for this example is following below.

Example 1: Enable Or Disable Submit Button Using Jquery

$(document).ready(function() {
     $(':input[type="submit"]').prop('disabled', true);
     $('input[type="text"]').keyup(function() {
        if($(this).val() != '') {
           $(':input[type="submit"]').prop('disabled', false);
        }
     });
 });

Example 2 : Enable Disable Submit Button Based on Validation

<input type="text" name="textTitle" name="suggestion_title" id="suggestion_title" value="" placeholder="Your title" required="" pattern=".{10,100}" maxlength="100" title="Title must be between 10 and 100 characters."/>
<input type="submit" value="send" />

$('input[type="submit"]').attr('disabled', true);
$('input[type="text"]').on('keyup',function() {
    if($(this).val() != '') {
        $('input[type="submit"]').attr('disabled' , false);
    }else{
        $('input[type="submit"]').attr('disabled' , true);
    }
});

Example 3 : enable/disable an element using jQuery

$(function() {
  $(":text").keypress(submitbtn).each(function() {
    submitbtn();
  });
});

function submitbtn() {
  if ($(this).val().length == 0) {
    $(":submit").attr("disabled", true);
  } else {
    $(":submit").removeAttr("disabled");
  }
}

Example 4 : jQuery Disable/Enable button in form

<!DOCTYPE html>
<html>
<head>
<title>Disable a button dynamically created</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    $('#textTitle').click(function() {
        $(this).prop('disabled',true);

        $("#ckcontent").show();
      
        setTimeout(function(){
           $('#textTitle').prop('disabled', false);
       },4000);
      
     });
});
</script>
</head>
<body>

<div id="btnregister" name="registerbtn">
<p>jQuery disable button — Disabling and enabling buttons with jQuery</p>
    <input type="submit" value="Click me!" id="textTitle" name="textTitle"/>
</div>
  
<div style="display:none;" id="ckcontent">
  The above Clcik button disables for 4 seconds, on clicking.                
</div>

</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery Enable Disable Submit Button Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP Laravel Inline CRUD Using jQuery and AJAX 0

PHP Laravel Inline CRUD Using jQuery and AJAX

Today, We want to share with you PHP Laravel Inline CRUD Using jQuery and AJAX.In this post we will show you Create Inline CRUD Using PHP, Laravel, jQuery and AJAX, hear for HTML5 Inline Editing with Laravel 5.7, MYSQL & jQuery Ajax we will give you demo and example for implement.In this post, we will learn about Inline Table Editing using jQuery Ajax Laravel and MySQL with an example.

PHP Laravel Inline CRUD Using jQuery and AJAX

There are the Following The simple About PHP Laravel Inline CRUD Using jQuery and AJAX Full Information With Example and source code.

As I will cover this Post with live Working example to develop jQuery AJAX Inline CRUD with PHP Laravel, so the jQuery AJAX Inline CRUD using PHP Laravel MySQL for this example is following below.

Phase 1 : Install Laravel Application

Simple HTML5 Inline Editing with Laravel 5.7, MYSQL & jQuery Ajax

Laravel 5.7 version application using bellow composer command

composer create-project --prefer-dist laravel/laravel system_project

Phase 2: MySQL .env files Database Configuration

database configuration in Laravel env files

.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=MyDBNAme
DB_USERNAME=DATABASE_USERNAME
DB_PASSWORD=MY_DATABASE_PASSWORD

Phase 3: Make a productlist Table and Model

make a Laravel migration for productlist table using Laravel 5.7

Table Name : productlist

php artisan make:migration create_productlist_table

database/migrations

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagslistTable extends Migration
{
    public function up()
    {
        Schema::create('productlist', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('productlist');
    }
}

run simple Laravel commands migration

Make a Laravel 5.7 migration and Model

php artisan migrate

php artisan make:model ProductList

app/ProductList.php

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ProductList extends Model
{
    public $table = "productlist";
    public $fillable = ['name'];
}

Phase 4: Define Laravel Routes

routes/web.php

Route::get("multipleInptFrm","[email protected]");
Route::post("multipleInptFrm","[email protected]");

Phase 5: Create ProductController

create new controller as ProductController

php artisan make:controller ProductController

app/Http/Controllers/ProductController.php

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\ProductList;
use Validator;

class ProductController extends Controller
{
    public function moreAddData()
    {
        return view("moreAddData");
    }
    public function moreAddDataPost(Request $request)
    {
        $rules = [];
        foreach($request->input('name') as $key => $value) {
            $rules["name.{$key}"] = 'required';
        }

        $validator = Validator::make($request->all(), $rules);
        if ($validator->passes()) {

            foreach($request->input('name') as $key => $value) {
                ProductList::create(['name'=>$value]);
            }

            return response()->json(['success'=>'done']);
        }
        return response()->json(['error'=>$validator->errors()->all()]);
    }
}

Phase 6: Make a Laravel Blade File

resources/views/moreAddData.blade.php

<!DOCTYPE html>
<html>
<head>
    <title>Inline Table Editing using jQuery Ajax Laravel and MySQL - Pakainfo.com</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  

 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  
    <meta name="csrf-token" content="{{ csrf_token() }}">
</head>
<body>


<div class="container">
    <h2 align="center">Laravel - HTML5 Inline Editing with Laravel 5.7, MYSQL & jQuery Ajax</h2>  
    <div class="form-group">
         <form name="product_name_add" id="product_name_add">  


            <div class="alert alert-danger message-errors-display" style="display:none">
            <ul></ul>
            </div>


            <div class="alert alert-success message-display" style="display:none">
            <ul></ul>
            </div>


            <div class="table-responsive">  
                <table class="table table-bordered" id="dynamic_field">  
                    <tr>  
                        <td><input type="text" name="name[]" placeholder="Enter your Name" class="form-control name_list" /></td>  
                        <td><button type="button" name="add" id="add" class="btn btn-success">Add More</button></td>  
                    </tr>  
                </table>  
                <input type="button" name="submit" id="submit" class="btn btn-info" value="Submit" />  
            </div>


         </form>  
    </div> 
</div>


<script type="text/javascript">
    $(document).ready(function(){      
      var postURL = "<?php echo url('multipleInptFrm'); ?>";
      var i=1;  


      $('#add').click(function(){  
           i++;  
           $('#dynamic_field').append('<tr id="row'+i+'" class="dynamic-added"><td><input type="text" name="name[]" placeholder="Enter your Name" class="form-control name_list" /></td><td><button type="button" name="remove" id="'+i+'" class="btn btn-danger btn_remove">X</button></td></tr>');  
      });  


      $(document).on('click', '.btn_remove', function(){  
           var button_id = $(this).attr("id");   
           $('#row'+button_id+'').remove();  
      });  


      $.ajaxSetup({
          headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
          }
      });


      $('#submit').click(function(){            
           $.ajax({  
                url:postURL,  
                method:"POST",  
                data:$('#product_name_add').serialize(),
                type:'json',
                success:function(data)  
                {
                    if(data.error){
                        displayMessageError(data.error);
                    }else{
                        i=1;
                        $('.dynamic-added').remove();
                        $('#product_name_add')[0].reset();
                        $(".message-display").find("ul").html('');
                        $(".message-display").css('display','block');
                        $(".message-errors-display").css('display','none');
                        $(".message-display").find("ul").append('<li>Record Inserted Successfully.</li>');
                    }
                }  
           });  
      });  


      function displayMessageError (msg) {
         $(".message-errors-display").find("ul").html('');
         $(".message-errors-display").css('display','block');
         $(".message-display").css('display','none');
         $.each( msg, function( key, value ) {
            $(".message-errors-display").find("ul").append('<li>'+value+'</li>');
         });
      }
    });  
</script>
</body>
</html>

run command

php artisan serve

// open bellow URL
http://localhost:8000/multipleInptFrm

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Laravel Inline CRUD Using jQuery and AJAX.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

jQuery DataTables Pagination Size Per Page 0

jQuery DataTables Pagination Size Per Page

Today, We want to share with you jQuery DataTables Pagination Size Per Page.In this post we will show you datatables change page length dynamically, hear for jquery datatables default number of rows we will give you demo and example for implement.In this post, we will learn about Change the default number of rows to display on one “page” with an example.

jQuery DataTables Pagination Size Per Page

There are the Following The simple About jQuery DataTables Pagination Size Per Page Full Information With Example and source code.

As I will cover this Post with live Working example to develop jquery datatable page size change event, so the some datatables pagination options for this example is following below.

<!DOCTYPE html>
<html>
<head>
    <title>jQuery datatable default page size set</title>
    
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.datatables.net/r/dt/dt-1.10.9/datatables.min.css" rel="stylesheet" type="text/css"/>
<script src="https://cdn.datatables.net/r/dt/dt-1.10.9/datatables.min.js"></script>
<style>
    .error{
        color:red;
        font-weight: 641px;
    }
</style>
</head>
<body>
<h3>jQuery DataTables: Pagination size</h3>

<table id="members_list" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>Product Name</th>
            <th>Brands</th>
            <th>Office</th>
            <th>Qty</th>
            <th>Production date</th>
            <th>Salary</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th>Product Name</th>
            <th>Brands</th>
            <th>Office</th>
            <th>Qty</th>
            <th>Production date</th>
            <th>Salary</th>
        </tr>
    </tfoot>
    <tbody>
        <tr>
            <td>Mobile</td>
            <td>Apple</td>
            <td>Jammnagar</td>
            <td>61</td>
            <td>2025/04/25</td>
            <td>$320,800</td>
        </tr>
        <tr>
            <td>Laravel 5.7 Books</td>
            <td>RP Prakashan</td>
            <td>Devpura</td>
            <td>63</td>
            <td>2025/07/25</td>
            <td>$170,750</td>
        </tr>
        <tr>
            <td>Vuejs Quick Books</td>
            <td>Junior Data Author</td>
            <td>Ahemdabad</td>
            <td>66</td>
            <td>2021/01/12</td>
            <td>$86,692</td>
        </tr>
        <tr>
            <td>Angularjs Books</td>
            <td>Zone TM</td>
            <td>Rajkot</td>
            <td>41</td>
            <td>2020/10/13</td>
            <td>$132,692</td>
        </tr>
        <tr>
            <td>PHP Books</td>
            <td>Personnel Lead</td>
            <td>Jammnagar</td>
            <td>35</td>
            <td>2020/09/26</td>
            <td>$217,641</td>
        </tr>
        <tr>
            <td>Magento Books</td>
            <td>Development Lead</td>
            <td>Surat</td>
            <td>30</td>
            <td>2025/09/03</td>
            <td>$345,692</td>
        </tr>
        <tr>
            <td>jQuery Books</td>
            <td>Chief Marketing Officer (CMO)</td>
            <td>Surat</td>
            <td>40</td>
            <td>2021/06/25</td>
            <td>$675,692</td>
        </tr>
        <tr>
            <td>HTML Books</td>
            <td>Pre-Sales Support</td>
            <td>Surat</td>
            <td>21</td>
            <td>2025/12/12</td>
            <td>$106,450</td>
        </tr>
        <tr>
            <td>CSS Books</td>
            <td>Sales Assistant</td>
            <td>Sidney</td>
            <td>23</td>
            <td>2023/09/20</td>
            <td>$85,600</td>
        </tr>
        <tr>
            <td>MySQL Books</td>
            <td>Chief Executive Officer (CEO)</td>
            <td>Rajkot</td>
            <td>47</td>
            <td>2021/10/09</td>
            <td>$1,825,692</td>
        </tr>
        <tr>
            <td>Ajax Books</td>
            <td>Prakashan</td>
            <td>Jammnagar</td>
            <td>42</td>
            <td>2023/12/22</td>
            <td>$92,575</td>
        </tr>
        <tr>
            <td>Java Books</td>
            <td>Regional Director</td>
            <td>Baroda</td>
            <td>28</td>
            <td>2023/11/14</td>
            <td>$357,650</td>
        </tr>
        <tr>
            <td>HTML Books</td>
            <td>Zone TM</td>
            <td>Ahemdabad</td>
            <td>28</td>
            <td>2025/06/07</td>
            <td>$206,850</td>
        </tr>
        <tr>
            <td>Linux Books</td>
            <td>Chief Operating Officer (COO)</td>
            <td>Ahemdabad</td>
            <td>48</td>
            <td>2023/03/11</td>
            <td>$850,692</td>
        </tr>
        <tr>
            <td>CI Books</td>
            <td>Regional Marketing</td>
            <td>Devpura</td>
            <td>20</td>
            <td>2025/08/14</td>
            <td>$163,692</td>
        </tr>
        <tr>
            <td>Michelle House</td>
            <td>Integration Specialist</td>
            <td>Sidney</td>
            <td>37</td>
            <td>2025/06/02</td>
            <td>$95,400</td>
        </tr>
        <tr>
            <td>Datatable Burks</td>
            <td>Prakashan</td>
            <td>Rajkot</td>
            <td>53</td>
            <td>2021/10/22</td>
            <td>$114,641</td>
        </tr>
        <tr>
            <td>Prescott Bartlett</td>
            <td>Technical Author</td>
            <td>Rajkot</td>
            <td>27</td>
            <td>2025/05/07</td>
            <td>$145,692</td>
        </tr>
        <tr>
            <td>Gavin Cortez</td>
            <td>Team Leader</td>
            <td>Ahemdabad</td>
            <td>22</td>
            <td>2026/10/26</td>
            <td>$235,641</td>
        </tr>
        <tr>
            <td>Martena Mccray</td>
            <td>Post-Sales support</td>
            <td>Jammnagar</td>
            <td>46</td>
            <td>2025/03/09</td>
            <td>$324,050</td>
        </tr>
        <tr>
            <td>Unity Butler</td>
            <td>Marketing Designer</td>
            <td>Ahemdabad</td>
            <td>47</td>
            <td>2021/12/09</td>
            <td>$85,675</td>
        </tr>
        <tr>
            <td>Howard Hatfield</td>
            <td>Office Manager</td>
            <td>Ahemdabad</td>
            <td>51</td>
            <td>2026/12/16</td>
            <td>$164,641</td>
        </tr>
        <tr>
            <td>Hope Fuentes</td>
            <td>Secretary</td>
            <td>Ahemdabad</td>
            <td>41</td>
            <td>2023/02/12</td>
            <td>$109,850</td>
        </tr>
        <tr>
            <td>Vivian Harrell</td>
            <td>Financial Controller</td>
            <td>Ahemdabad</td>
            <td>62</td>
            <td>2021/02/14</td>
            <td>$452,641</td>
        </tr>
        <tr>
            <td>Timothy Mooney</td>
            <td>Office Manager</td>
            <td>Rajkot</td>
            <td>37</td>
            <td>2026/12/11</td>
            <td>$136,825</td>
        </tr>
        <tr>
            <td>Jackson Bradshaw</td>
            <td>Director</td>
            <td>Surat</td>
            <td>65</td>
            <td>2026/09/26</td>
            <td>$645,750</td>
        </tr>
        <tr>
            <td>Olivia Liang</td>
            <td>Support TM</td>
            <td>Baroda</td>
            <td>64</td>
            <td>2025/02/03</td>
            <td>$234,641</td>
        </tr>
        <tr>
            <td>Bruno Nash</td>
            <td>Zone TM</td>
            <td>Rajkot</td>
            <td>38</td>
            <td>2025/05/03</td>
            <td>$163,641</td>
        </tr>
        <tr>
            <td>Sakura Yamamoto</td>
            <td>Support TM</td>
            <td>Devpura</td>
            <td>37</td>
            <td>2021/08/19</td>
            <td>$139,575</td>
        </tr>
        <tr>
            <td>Thor Walton</td>
            <td>Prakashan</td>
            <td>Surat</td>
            <td>61</td>
            <td>2024/08/11</td>
            <td>$98,540</td>
        </tr>
        <tr>
            <td>Finn Camacho</td>
            <td>Support TM</td>
            <td>Ahemdabad</td>
            <td>47</td>
            <td>2021/07/07</td>
            <td>$87,641</td>
        </tr>
        <tr>
            <td>Serge Baldwin</td>
            <td>Data Coordinator</td>
            <td>Baroda</td>
            <td>64</td>
            <td>2020/04/09</td>
            <td>$138,575</td>
        </tr>
        <tr>
            <td>Zenaida Frank</td>
            <td>Zone TM</td>
            <td>Surat</td>
            <td>63</td>
            <td>2023/01/04</td>
            <td>$125,250</td>
        </tr>
        <tr>
            <td>Zorita Serrano</td>
            <td>Zone TM</td>
            <td>Ahemdabad</td>
            <td>56</td>
            <td>2020/06/01</td>
            <td>$115,692</td>
        </tr>
        <tr>
            <td>Jennifer Acosta</td>
            <td>Junior Javascript Prakashan</td>
            <td>Jammnagar</td>
            <td>43</td>
            <td>2024/02/01</td>
            <td>$75,650</td>
        </tr>
        <tr>
            <td>Cara Stevens</td>
            <td>Sales Assistant</td>
            <td>Surat</td>
            <td>46</td>
            <td>2025/12/06</td>
            <td>$145,600</td>
        </tr>
        <tr>
            <td>Hermione Butler</td>
            <td>Regional Director</td>
            <td>Rajkot</td>
            <td>47</td>
            <td>2025/03/21</td>
            <td>$356,250</td>
        </tr>
        <tr>
            <td>Lael Greer</td>
            <td>Systems Administrator</td>
            <td>Rajkot</td>
            <td>21</td>
            <td>2021/02/27</td>
            <td>$103,641</td>
        </tr>
        <tr>
            <td>Jonas Alexander</td>
            <td>Prakashan</td>
            <td>Ahemdabad</td>
            <td>30</td>
            <td>2023/07/14</td>
            <td>$86,641</td>
        </tr>
        <tr>
            <td>Shad Decker</td>
            <td>Regional Director</td>
            <td>Jammnagar</td>
            <td>51</td>
            <td>2026/11/13</td>
            <td>$183,692</td>
        </tr>
        <tr>
            <td>Michael Bruce</td>
            <td>Javascript Prakashan</td>
            <td>Baroda</td>
            <td>29</td>
            <td>2025/06/27</td>
            <td>$183,692</td>
        </tr>
        <tr>
            <td>Donna Snider</td>
            <td>Customer Support</td>
            <td>Surat</td>
            <td>27</td>
            <td>2025/01/25</td>
            <td>$112,692</td>
        </tr>
    </tbody>
</table>
<h1>jQuery DataTables Pagination Size - Example</h1>
<script>
$(document).ready(function (){
    var table = $('#members_list').DataTable({
       lengthMenu: [ [2, 4, 8, -1], [2, 4, 8, "All"] ],
       pageLength: 4
    });
});
 
</script>
</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery DataTables Pagination Size Per Page.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.