You could simplify to this.
Code:
function capt(fields)
{
for (var i = 0; i < fields.length; i++)
{
var oField = fields[i];
if (oField.checked)
{
window.location.href="../CatLPMaestro/LPSustituidosDetalle.asp?PS_Id=" + oField.value;
return;
}
}
alert("Antes de ejecutar esta acción debe seleccionar una de las opciones listadas");
}
A word of warning, all elements are supposed to have different IDs. Although some browsers allow you to give them the same ones and treat it as a collection a compliant one won't and your code would crash. Also only IE lets you pass an id an element reference
Give them the same name and either no id or an id that is individual such as
. Then modify call to:
Code:
onClick="capt(document.getElementsByName('list'));"
--
Joe