Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/11/2009, 19:58
Avatar de willyfc
willyfc
 
Fecha de Ingreso: octubre-2008
Ubicación: Santa Cruz - Bolivia
Mensajes: 662
Antigüedad: 15 años, 7 meses
Puntos: 40
Respuesta: obtener el valor de un checkbox

Bueno, tampoco especificaste eso y además estamos en el foro de PHP, pero bueno, tendría que ser por el checked si no entiendo mal, por ejemplo.

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<script type="text/javascript" src="utiles/ajax.js">

</script>
</head>
 
<body>
<form action="" method="post" onsubmit="probar_c();return false;">
    <input type="checkbox" name="v_reg_usuAgree" id="v_reg_usuAgree" checked="checked" />
    <input type="submit" value="ch" name="enviar" />
</form>
</body>
</html>
y en el archivo ajax:

Código:
function probar_c(){
	var v_agree = document.getElementById("v_reg_usuAgree");
	if (v_agree.checked == true)
	{
		alert("on")	
	}
	else{alert("off");}
}
esto es solo para probarlo

y luego quitar los alerts y poner lo del envió.
__________________
WFC
codigo82

Última edición por willyfc; 06/11/2009 a las 07:05