Code
<table id="container">
<tr>
<td>
<label><input type="checkbox">aaaa</label>
<label><input type="checkbox">bbb</label>
<label><input type="checkbox">ccc</label>
<br/>
<input type="button" value="submit" onclick="if (!CheckChecked('container')) window.alert('choose one item!');"/>
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
function CheckChecked(container_name)
{
var container = document.getElementById(container_name);
var inputs = container.getElementsByTagName("input");
for (var i=0; i<inputs.length; i++)
{
if (inputs[i].type == "checkbox")
{
if (inputs[i].checked == true)
{
return true;
}
}
}
return false;
}
</script>
<table id="container">
<tr>
<td>
<label><input type="checkbox">aaaa</label>
<label><input type="checkbox">bbb</label>
<label><input type="checkbox">ccc</label>
<br/>
<input type="button" value="submit" onclick="if (!CheckChecked('container')) window.alert('choose one item!');"/>
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
function CheckChecked(container_name)
{
var container = document.getElementById(container_name);
var inputs = container.getElementsByTagName("input");
for (var i=0; i<inputs.length; i++)
{
if (inputs[i].type == "checkbox")
{
if (inputs[i].checked == true)
{
return true;
}
}
}
return false;
}
</script>