<script>
function addrow(id)
{
	var table=document.getElementById(id);
	var rowcount=table.rows.length;
	var row=table.insertRow(rowcount);
	var colcount=table.rows[1].cells.length;
	for(var i=0;i<colcount;i++)
	{
		var newcell=row.insertCell(i);
		newcell.innerHTML=table.rows[1].cells[i].innerHTML;
	}
}


function delete_row(tid){
	var table=document.getElementById(tid);
	var rowcount=table.rows.length;
	for(var i=0;i<=rowcount;i++)
	{
		var chkbox=table.rows[i].cells[0].childNodes[0];
		if(chkbox!=null && chkbox.checked==true)
			
			{
				if(rowcount<=2)
				{
				alert("ca'nt delete all row");	
					break;
				}
				table.deleteRow(i);
				i--;
				rowcount--;
				
			}
	}
	
	
}


</script>
<?php $__env->startSection('content'); ?>
                
<div class="col-sm-6 col-sm-offset-3">
                         <h3 class="text-center">Create Category</h3> 

                         <?php if(session('status')): ?>
<p class="alert alert-success"><?php echo e(session('status')); ?></p>
<?php endif; ?>
  <input type="button" value="add row" onclick="addrow('tid')" />
<input type="button" value="delete row" onclick="delete_row('tid')" /><br/><br/>
<form action="<?php echo e(route('savereg')); ?>" method="post" >
<?php echo csrf_field(); ?>
<table border="1" width="50%" style="text-align:center" id="tid" >
	<thead>
		<tr>
		    <th> &nbsp;</th>
			<th>Choice</th>
			<th>Name</th>
			<th>Email</th>
		</tr>
		
	</thead>
	<tbody>
	<tr>
	<td><input type="checkbox" /></td>
	<td><select name="choice[]">
	<option>-- Select Choice --</option>
	<option>Dancing</option>
	<option>Singing</option>
	<option>reading</option>
	<option>Writing</option>
	
	</select>
	</td>
	<td><input type="text" name="name[]" /></td>
	<td> <input type="text" name="email[]" /></td>	</tr>
	</tbody>
</table>
<br/>
<input type="submit" value="save me"  />
</form>

                             
        </div>



     <?php $__env->stopSection(); ?>
             
<?php echo $__env->make('layout/master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\sangya\resources\views/registration.blade.php ENDPATH**/ ?>