I'm working on a checkbox that triggers AJAX to create a new log. It populates the necessary information and automatically clicks the "create" button. However, I'm facing an issue where the hour value is not changing. Any help on what I might be doing wrong?
$canEdit = getPermission('tasks', 'edit', $a['task_id']);
$canViewLog = getPermission('task_log', 'view', $a['task_id']);
if ($canEdit) {
$s .= ("\n\t\t".'<a href="#">'
. "\n\t\t\t".'<input type="checkbox" onclick="createlog()" alt="' . $AppUI->_('Check')
. '" border="0" width="12" height="12" />' . "\n\t\t</a>");
}
$s .= "\n\t</td>";
?>
<script type="text/javascript">
function createlog(){
$.ajax({
type:'POST',
url:'?m=tasks&a=view&tab=1&task_id=' . $a['task_id'] .'',
data: {url: $('task_log_hours').value(8)
})
}
</script>