How to check all check box By clicking one checkbox

Js

Posted on 30 Jan 15 by Vickey
  679

I have html table of users with a checkbox for each row. i want check all checkbox by clicking on checkbox on the top

<form id="form">
<table>
	<tbody>
		<tr>
			<th><input type="checkbox" onclick="checkedAll();" /></th>
			<th>Name></th>
			<th>>Phone</th>
		</tr>
		<tr>
			<td><input type="checkbox" /></td>
			<td>Ram</td>
			<td>6456456464</td>
		</tr>
		<tr>
			<td><input type="checkbox" /></td>
			<td>Ram</td>
			<td>6456456464</td>
		</tr>
	</tbody>
</table>

 

for check all checkbox i used js code by using form id

checked = false;
     function checkedAll ()
        {
        if (checked == false)
            {
            checked = true
            }
        else
            {
            checked = false
            }
    for (var i = 0; i < document.getElementById("form").elements.length; i++)
        {
        document.getElementById("form").elements[i].checked = checked;
        }
      }

How to migrate laravel in ubuntu xampp server

Laravel

Posted on 30 Jan 15 by Vickey
  1207

I have ubuntu on my computer and i used laravel migrate on my system by doing these processes

1.Go to laravel project folder in terminal window by this command

cd /opt/lampp/htdocs/laravelapp

Install migrate by this command

php artisan migrate:install

Now create new migration

artisan migrate:make createuserstable --create=users

it will create new file for migration you can add new columns in this file like this

Schema::create('users', function(Blueprint $table) { 

     $table->increments('id'); $table->string('name', 32);
     $table->string('username', 32); 
     $table->string('email', 320); 
    $table->string('password', 64); $table->timestamps();

 });

and now run this command

php artisan migrate

Done

www.000webhost.com