Laravel Check and uncheck all checkbox using jquery – Technology

Laravel Check and uncheck all checkbox using jquery – Technology

In this post we will give you information about Laravel Check and uncheck all checkbox using jquery – Technology. Hear we will give you detail about Laravel Check and uncheck all checkbox using jquery – TechnologyAnd how to use it also give you demo for it if it is necessary.

Today, We want to share with you Laravel Check and uncheck all checkbox using jquery.In this post we will show you Check/Uncheck All CheckBoxes using Laravel, hear for Check and Uncheck all checkbox using Laravel Example we will give you demo and example for implement.In this post, we will learn about How to Select / Deselect All Checkboxes using Laravel with an example.

Laravel Check and uncheck all checkbox using jquery

There are the Following The simple About Laravel Check and uncheck all checkbox using jquery Full Information With Example and source code.

As I will cover this Post with live Working example to develop Check Uncheck All Checkbox using Laravel, so the Laravel select all checkboxes in table column for this example is following below.

List of all Google Adsense, VueJS, AngularJS, PHP, Laravel Examples.

index.html

<html lang="en">
<head>
    <title>Laravel Select and deselect all checkboxes using jquery</title>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
  <ul>
    <li><input name="category_all"  type="checkbox">Select All</li>
    <li><input value="1" name="category"  type="checkbox">Product 1  </li>
    <li> <input value="2" name="category"  type="checkbox">Product 2  </li>
    <li><input value="3" name="category"  type="checkbox">Product 3  </li>
    <li><input value="4" name="category"  type="checkbox">Product 4  </li>
    <li><input value="5" name="category"  type="checkbox">Product 5 </li>
   </ul>
    <script type="text/javascript">
        $('.select_all').on('change', function() {     
                $('.checkbox').prop('checked', $(this).prop("checked"));              
        });
        //deselect "checked all", if one of the listed checkbox category is unchecked amd select "checked all" if all of the listed checkbox category is checked
        $('.checkbox').change(function(){ //".checkbox" change 
            if($('.checkbox:checked').length == $('.checkbox').length){
                   $('.select_all').prop('checked',true);
            }else{
                   $('.select_all').prop('checked',false);
            }
        });
    </script>
	<a href="https://onlinecode.org/" target="_blank" alt="pakainfo" title="pakainfo">Free Download Example - onlinecode</a>

</body>
</html>

Select and Clear all check-boxes using Laravel

HTML Form

@extends('app')
@section('content')

    <h1>Welcome! Send e-mail to selected Members.</h1>
    <hr>
    {!! Form::open(array('action' => '[email protected]','method' => 'GET','name'=>'f1' , 'id'=>'form_id'))!!}
    <br/>
        @foreach($members as $member)
            <div >
            {!! Form::checkbox("status[]", $member->email, null,['id' => $member->email], ['class' => 'questionCheckBox']), $member->email !!}
            <br/>
            </div>
        @endforeach
    <div >
    {!! Form::submit('Send Mail',['class' => 'btn btn-primary span3']) !!}
    </div>

    <div >
    {!! Form::button('Select All',['class' => 'btn btn-default span3','onClick'=>'select_all("status", "1")']) !!}
    </div>

    <div >
    {!! Form::button('Clear All',['class' => 'btn btn-danger span3','onClick'=>'select_all("status", "0")']) !!}
    </div>

    {!! Form::close() !!}
@stop
@endsection

Simple Js Code

<script type="text/javascript">

    var userfrmBlock;
    var userfrmData;

    function prepare() {
        userfrmBlock= document.getElementById('form_id');
        userfrmData = userfrmBlock.getElementsByTagName('input');
    }

    function select_all(name, value) {
        for (i = 0; i < userfrmData.length; i++) {
            var regex = new RegExp(name, "i");
            if (regex.test(userfrmData[i].getAttribute('name'))) {
                if (value == '1') {
                    userfrmData[i].checked = true;
                } else {
                    userfrmData[i].checked = false;
                }
            }
        }
    }

    if (window.addEventListener) {
        window.addEventListener("load", prepare, false);
    } else if (window.attachEvent) {
        window.attachEvent("onload", prepare)
    } else if (document.getElementById) {
        window.onload = prepare;
    }
</script>
Angular 6 CRUD Operations Application Tutorials

Read :

Another must read:  ng-mouseup Event using Angular Example

Summary

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

I hope you get an idea about Laravel Check and uncheck all checkbox using jquery.
I would like to have feedback on my onlinecode 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.

Hope this code and post will helped you for implement Laravel Check and uncheck all checkbox using jquery – Technology. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

7  +  3  =  

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US