a标签提交表单

时间:2022-01-20 00:58:55


<form action="todo.php" method="post"  name="form_add_todo">

<input type="checkbox" value="<?php echo $value['completed'] == 1 ? 'true' : 'false' ?>">

<?php echo $value['content'] ?>
-
<a href="#" class="delete" >删除</a>
<input type="hidden" name="type" value="delete">
<input type="hidden" name="id" value="<?php echo $value['id'];?>">
<!-- <input type="submit" class="input_delete" style="display:none" value="确认删除"/>-->
</form>
<script>

$(function () {
$('.delete').each(function (i) {
this.onclick = function () {
$('#form_add_todo').eq(i).submit();
return false;
};
});
});
</script>