Jump to content

Radio Form check if true


tobeyt23

Recommended Posts

I did this and it seems to work, does anyone see something wrong with it?

function radioEducationHasValue()
{
var found = false;

els = document.getElementsByName('hs_grade');
for(j=0;test = els[j];j++)
{
	if( test.checked )
	{
		found = true;
	}
}

els = document.getElementsByName('c_grade');
for(j=0;test = els[j];j++)
{
	if( test.checked )
	{
		found = true;	
	}
}

els = document.getElementsByName('post_grad');
for(j=0;test = els[j];j++)
{
	if( test.checked )
	{
		found = true;	
	}
}

if( !found )
{
	alert('Highest level compeleted must have one selected'); 

	return false;
}
return true;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.