como pudo desactivar un radiobutton cuando el otro ya esta activado......por el momento cuando presiono uno ydespues el otro ambos quedan seleccionado
les dejo el codigo.....(lo saque de aqui mismo de las faq)
muchas gracias de antemano :D
Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/fullbody.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
</head>
<body>
<script>
//Script original de KarlanKas para forosdelweb.com
//Adaptado a firefox gracias a JavierB ;-)
colorMal="#FFFFEE";
colorBien="white";
mensaje=new Array()
function comprobar(){
errores="";
mensaje2="";
if(document.form.cod_local.value == "" || document.form.cod_local.value<4){
mensaje2=mensaje2+"<font color='red'><b>Ingrese Codigo de Local existente<br></font>";
document.forms[0].elements["cod_local"].style.background=colorMal;
}
if(document.form.radiobutton1.checked==false && document.form.radiobutton2.checked==false){
mensaje2=mensaje2+"<font color='red'><b>Debe seleccionar una opcion<br></font>";
document.forms[0].elements["cod_local"].style.background=colorMal;
}else{
if(document.form.radiobutton1.checked){
if(document.form.bultos_max.value == "" && document.form.lineas_max.value == ""){
mensaje2=mensaje2+"<font color='red'><b>Debe ingresar valor para Bultos o Lineas<br></font>";
document.forms[0].elements["bultos_max"].style.background=colorMal;
}
}else{
if(document.form.radiobutton2.checked){
if(document.form.mc_max.value == ""){
mensaje2=mensaje2+"<font color='red'><b>Debe ingresar valor para M3<br></font>";
document.forms[0].elements["mc_max"].style.background=colorMal;
}
}
}
}
if(document.form.cobertura_min.value == "" || document.form.cobertura_min.value <0 || document.form.cobertura_min.value >999999999){
mensaje2=mensaje2+"<font color='red'><b>Valor de Cobertura minima no es valido<br></font>";
document.forms[0].elements["cobertura_min"].style.background=colorMal;
}
errores+=mensaje2+"<br>";
pepe=document.getElementById("herror");
pepe.style.background=(errores!="")?colorMal:colorBien;
pepe.style.border=(errores!="")?"solid 1px black":"none";
pepe.innerHTML=errores;
return (errores=="")
}
</script>
<SCRIPT LANGUAGE="JavaScript">
var arr_local = new Array(1);
arr_local[0] = new Array(); // id_local
function valida(){
cod_cd = document.form.cod_local.value;
document.form.id_local_ciclo.value = arr_local[cod_cd];
}
function valida2(){
cod_cd = document.form.cod_local.value;
var unde = 'undefined';
if(document.form.id_local_ciclo.value == unde && document.form.id_local_ciclo.value != null){
alert("El codigo de local no petenece al ciclo");
return false;
}
}
</SCRIPT>
<form name="form" action="add_regla.htm" method ="post" onsubmit="return comprobar()">
<table width="610" border="0" cellspacing="2" cellpadding="0">
<tr>
<td> </td>
<td valign="top">Local</td>
<input type="hidden" name="cod_cd" value="$cod_cd">
<input type="hidden" name="size_lista_clase_pedido" value="$size_lista">
<td>
<input id="locales" name="cod_local" autocomplete="off" size="4" type="text" onkeypress="return upperCase(event)" maxlength="4" onblur="valida();"/>
<div class="page_name_auto_complete" id="local_list" style="display:none"></div>
<script type="text/javascript">
new Autocompleter.Local('locales', 'local_list', [ $!str_locales ], {});
</script>
</td>
</tr>
<tr>
<td width="32"><p><br>
</p></td>
<td width="233" valign="top">Ajustar líneas </td>
<td width="337"><input name="radiobutton1" type="radio" value="1" >
<input name="bultos_max" type="text" class="small" maxlength="9" onkeypress="return Numeros(event)">bultos ó
<input name="lineas_max" type="text" class="small" maxlength="9"onkeypress="return Numeros(event)">líneas <br>
<input name="radiobutton2" type="radio" value="2">
<input name="mc_max" type="text" class="small" maxlength="9" onkeypress="return Numeros(event)">m3</td>
</tr>
<tr>
<td> </td>
<td valign="top">No postergar líneas </td>
<td><input name="cobertura_min" type="text" class="small" onkeypress="return Numeros(event)" maxlength="9" alt="number|0|0|999999999">días </td>
</tr>
</table>
<br>
</fieldset></td>
</tr>
</table>
<br>
<table width="73%" border="0" align="center" cellpadding="0" cellspacing="0"><tr>
<td style="font:normal 10px/15px verdana;padding:5px 5px 5px 5px;"rowspan=10 valign="top" id="herror"></td>
</tr></table>
<br>
<table width="192" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td align="center"><input name="Submit" type="submit" class="cmd" value=" Aceptar " ></td>
<td align="center"><input name="Submit" type="button" class="cmd" value=" Cancelar " onClick="location.href='param_posterg3.htm?cod_cd=$!cod_cd'"></td>
</tr>
</table>
</form>
</body>
</html>
muchas gracias por leerme