do not let an empty bug form be submitted

http://manage.dimagi.com/default.asp?146771#816736
These two lines are nearly identical to the ones below for `$ccFormGroup`. Making it a function would be good.