[ create a new paste ] login | about

Link: http://codepad.org/CvzgGeOd    [ raw code | output | fork ]

PHP, pasted on Sep 23:
$(".chk").click(function(e){
           e.preventDefault();
           var id = $(this).parent().attr('id');
           $.ajax({
              type: 'post',
               url:'/Home/chktodo',
               data: 'id='+id,
               success : function(data) {

               }
           })
       });

foreach($View as $view):
    echo $view['Todolist']['details'];?> :To Do List
<div id = "<?= $view['Todolist']['id']?>">
<a id="todo" href="#">add to do</a>
<div id="clearNiPela-<?= $view['Todolist']['id'] ?>"></div>
</div>
<?php $todo = $view['Todo']; foreach($todo as $do): ?>
<div id="hours"> Hours :<?= $do['hours'];?></div>
<div id="description"> Description :<?= $do['description'];?></div>

<?= 
$this->Form->create('Todo',array('url' => '/Home/chktodo'));?>
<div id="<?='desc'.$do['id']?>">
<?=$this->Form->input('active',array('class' => 'chk','type' => 'checkbox','div'=>false))
.'<br />'.
$this->Form->end(); ?>
    </div>
<?php endforeach; endforeach; ?>


Output:
1
2

Parse error: syntax error, unexpected T_ENDFOREACH on line 31


Create a new paste based on this one


Comments: