Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/11/2010, 07:51
Die90
 
Fecha de Ingreso: noviembre-2010
Mensajes: 13
Antigüedad: 13 años, 6 meses
Puntos: 0
Respuesta: ocultar checkbox automaticamente y definitivo

funcion:

Cita:
function estado()
{
if (document.frm.box1.checked)
{
document.getElementById("box1").style.visibility=" hidden";
}

if (document.frm.box2.checked)
{
document.getElementById("box2").style.visibility=" hidden";
}
}

pag.html

Cita:
<html>
<head>

<script src="fun.js" type="text/jscript"></script>

</head>

<body onLoad="estado()">

<form name="frm" action="otra.php" method="post" >
<p>
<input type="checkbox" name=box1 value="1">
1</p>
<p>
<input type="checkbox" name=box2 value="2">
2 </p>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submit" value="Enviar" onClick="javascript: alert('cargando.....');" >
<br>
</p>
</form>

</body>
</html>

otra.php

Cita:
<html>

<body>
<?
$c=$_POST['box1'];

if($c== 1)
{
echo 'ok1';

}
?>
<?
$c=$_POST['box2'];

if($c== 2)
{
echo 'ok2';
}

?>

<form name="form1" method="post" action="pag.php" >
<input type="submit" name="Submit" value="Enviar">
</form>
<p>&nbsp;</p>
</body>
</html>