Check to make sure element is there before looking inside

This commit is contained in:
Nathan Gray 2012-04-05 20:16:54 +00:00
parent f045f6e4f8
commit 8d9c033cbf

View File

@ -75,11 +75,11 @@ function status_changed(changed_id, status_id, percent_id, datecompleted_id)
}
break;
}
if (!completed && datecompleted.value != '')
if (!completed && datecompleted && datecompleted.value != '')
{
datecompleted.value = '';
}
else if (completed && datecompleted.value == '')
else if (completed && datecompleted && datecompleted.value == '')
{
// todo: set current date in correct format
}