Although it might work in most browsers (might!!) you should never rely on using the id attribute as a global variable. This is just "bad habit".
So instead of
you should do
var theForm = document.getElementById('formtag');
var theGender = theForm.getElementsByName('gender');
if(!theGender.checked && !theGender.checked)