Foros del Web » Programando para Internet » Javascript »

Como hacer un checkbox que seleccione todos

Estas en el tema de Como hacer un checkbox que seleccione todos en el foro de Javascript en Foros del Web. Como hacer un checkbox que seleccione todos hola aqui molestando de nuevo, mi duda es la siguiente: es posible crear un checkboxs, que sea capas ...
  #1 (permalink)  
Antiguo 03/12/2008, 11:17
Avatar de Esfinge02  
Fecha de Ingreso: septiembre-2008
Ubicación: Cd. Victoria Tam
Mensajes: 162
Antigüedad: 15 años, 7 meses
Puntos: 2
Pregunta Como hacer un checkbox que seleccione todos

Como hacer un checkbox que seleccione todos

hola aqui molestando de nuevo, mi duda es la siguiente:

es posible crear un checkboxs, que sea capas de seleccionar a todos los demas, creo que el ejemplo mas visto es el de la bandeja entrada de windows en MSN, donde puedes selccionar la obcion para marcar todos los correos.

quisiera aser algo similar en una lista que despliego por medio de un ciclo...
  #2 (permalink)  
Antiguo 03/12/2008, 11:31
Avatar de Muzztein  
Fecha de Ingreso: agosto-2002
Ubicación: Hangar 18
Mensajes: 1.703
Antigüedad: 21 años, 8 meses
Puntos: 16
Respuesta: Como hacer un checkbox que seleccione todos

sip. eso se puede hacer con Javascript.
lo mas probable que en ese foro puedas encontrar lo que quieres en el FAQ
  #3 (permalink)  
Antiguo 03/12/2008, 13:45
Avatar de Esfinge02  
Fecha de Ingreso: septiembre-2008
Ubicación: Cd. Victoria Tam
Mensajes: 162
Antigüedad: 15 años, 7 meses
Puntos: 2
Respuesta: Como hacer un checkbox que seleccione todos

ok, ahora la pregunta seria solo es posible hacer lo con Javascript
  #4 (permalink)  
Antiguo 03/12/2008, 13:55
Avatar de Muzztein  
Fecha de Ingreso: agosto-2002
Ubicación: Hangar 18
Mensajes: 1.703
Antigüedad: 21 años, 8 meses
Puntos: 16
Respuesta: Como hacer un checkbox que seleccione todos

si, solo es posible hacerlo con JS
  #5 (permalink)  
Antiguo 03/12/2008, 14:20
Avatar de Esfinge02  
Fecha de Ingreso: septiembre-2008
Ubicación: Cd. Victoria Tam
Mensajes: 162
Antigüedad: 15 años, 7 meses
Puntos: 2
Pregunta como hacer un checkbox que seleccione todos

pregunta como puede aser un checkbox, para que seleccione, todos los checkbos de una lista, me handicho es posible aserlo por javascript,

creo que es importente que la pantalla que estoy asiendo contiene asp.
  #6 (permalink)  
Antiguo 03/12/2008, 17:06
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Respuesta: como hacer un checkbox que seleccione todos

Revisa este tema: http://www.forosdelweb.com/f13/selec...eckbox-490465/. O también: http://www.google.com/search?q=site%...eccionar+todos
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #7 (permalink)  
Antiguo 03/12/2008, 20:20
Avatar de Esfinge02  
Fecha de Ingreso: septiembre-2008
Ubicación: Cd. Victoria Tam
Mensajes: 162
Antigüedad: 15 años, 7 meses
Puntos: 2
Pregunta Respuesta: como hacer un checkbox que seleccione todos

bueno e estado viendo el codigo y e visto que no se parese a lo que ocupo o no se me ocurre como como a plicarlo anexo mi codigo para uque se den una idea

Cita:

<!--#include file="funciones/funciones.asp"-->
<%
If Session("maestro") = "" Then response.Redirect("cerrar_secion.asp")

response.Expires = 0
response.CacheControl = "privade"
response.CacheControl = "no-cache"
response.CacheControl = "no-store"

Session("inicial") = false
Session("respuesta") = false

dim idc
idc = request.QueryString("idc")
If idc = 1 Then
iF Session("inicial") = true Then Session("inicial") = false Else Session("inicial") = true
Session("respuesta") = false
End If

If idc = 2 Then
iF Session("respuesta") = true Then Session("respuesta") = false Else Session("respuesta") = true
Session("inicial") = false
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>
.:Mensajes Para Alumnos:.
</title>

<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script language="javascript" src="js/Google_Javanew.js" type="text/javascript"></script>
<link href="beta2as.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="js/swfobject.js"></script>
</head>

<body style="font-size: 12px">

<div id="container">

<!-- Start of Page Header -->


<!-- Aqui va a ir el script............... -->
<object type="application/x-shockwave-flash" data="images/head.swf" width="100%" height="185" align="middle">
<param name="movie" value="images/head.swf" />
<param name="wmode" value="opaque" />
</object>
<div id="page_content" style="width:100%">
<div id="welcome_text">
<br />
<p style="text-align:center; font-size:18px;"><b>Sistema Integral de Tutorias y Asesorias Academicas</b></p>
<br/>
<p style="text-align:center; font-size:15px;"><b>Modulo del Profesor.</b></p>
</div>
<div class="content_box" id="menuwrapper" align="center">
<!--#include file="menuprofe.asp"-->
</div>
<%
CALL Conecta()

strSQL15 = "select * from cat_periodo where activado = 1"
'response.Write (strSQL15)
'response.End
set rs15 = Conn.Execute(strSQL15)
periodo = rs15("idperiodo")

%>
<!-- Start of Order Cards -->

<div id="order_cardas1" style="width: 730px;" align="center">
<%if Session("inicial") = true then %>
<div style="width:700px; height:auto;" align="left">
<%
strSQL3 = "exec listadecontactos " & session("maestro")
set rs3 = Conn.execute(strSQL3)
%>
<form action="insmensajeforo.asp?periodo=<%=periodo%>" method="post" name="insert">
<p style="font-family:Arial Black; font-size:12px;">En este Apartado podrás mandar mensajes a tus distintos tutorados.</p>
<table width="100%" cellpadding="0">
<tr>
<td style="vertical-align:top; width: 150px;">
<div style=" border-right:#ffffff 1px solid; height:250px; width:150px; font-family:Arial Black;">
<table border="0" width="100%" style="text-align:left; font-size:12px;">
<tr valign="top">
<td>
<div style="text-align:center; background-color:#CCCCFF;"><br />Mensajes.<br /><br /></div>
<br />
<div class="vincmunudiv"><a href="profesor.asp?idc=4">Del Departamento </a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeforo2.asp">Recibidos </a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeforo.asp">Enviados</a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeprofe.asp?idc=1">Escrivir Mensaje</a></div></td>
</tr>
</table>
</div>
</td>
<td>
<div>

<table border="0" width="100%">
<tr>
<td colspan="2" style="padding:10px;">
&nbsp;<b> Seleccione los alumnos a los que Quiere mandar el mensaje</b></td>
</tr>
<%
do until rs3.eof
%>
<tr>
<td colspan="2" style="padding:10px;">

<input id="chk<%=Rs3("matricula")%>" type="checkbox" name="chk<%=Rs3("matricula")%>" value="1" <%iF selec = true Then response.write("checked=""checked""") %> />
<%=rs3("alumno")%>
</td>
</tr>
<%
rs3.movenext
loop
%>
<tr>
<td colspan="2" style="padding:10px;">
<br />
&nbsp; <b>Titulo del Mensaje</b><br />
<input id="titulo" style="width:364px" type="text" name="titulo" maxlength="50" /><br />
<br />
&nbsp; <b>Mensaje.</b></td>
</tr>
<tr>
<td style="height: 40px; padding:10px;" colspan="2">
<textarea id="mensaje" name="mensaje" cols="550px" rows="120px" style="width: 500px; height: 120px"></textarea></td>
</tr>
<tr>
<td style="height: 24px" colspan="2">
<input id="insert" name="insert" type="submit" value="Guardar" /></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</div>
<%end if %>
</div>
<%CALL Desconecta()%>

<!-- End of Page Content -->
<!-- Start of Footer Links -->

<div id="footer_links">

<ul>
<li><a href="index.asp">Inicio</a></li>
<li><a href="quienes_somos.asp">Quienes Somos</a></li>
<li><a href="desacargas.asp">Descargas</a></li>
<li><a href="mensage.asp">Mensaje del Director</a></li>
<li><a href="pregunta.asp">Preguntas Frecuentes</a></li>
</ul>
</div>
<!-- End of Footer Links -->


<!-- Start of Page Footer -->
<hr width="740"/>
UAMCAV &copy; <%=year(date)%> Derechos Reservados
<!-- End of Page Footer -->


</div>

</body>
</html>
  #8 (permalink)  
Antiguo 03/12/2008, 20:30
Avatar de Esfinge02  
Fecha de Ingreso: septiembre-2008
Ubicación: Cd. Victoria Tam
Mensajes: 162
Antigüedad: 15 años, 7 meses
Puntos: 2
Respuesta: como hacer un checkbox que seleccione todos

jejeje perdon puse demasiado deje editarlo para lo prinsipal...



Cita:

<!--#include file="funciones/funciones.asp"-->
<%
If Session("maestro") = "" Then response.Redirect("cerrar_secion.asp")

response.Expires = 0
response.CacheControl = "privade"
response.CacheControl = "no-cache"
response.CacheControl = "no-store"

Session("inicial") = false
Session("respuesta") = false

dim idc
idc = request.QueryString("idc")
If idc = 1 Then
iF Session("inicial") = true Then Session("inicial") = false Else Session("inicial") = true
Session("respuesta") = false
End If

If idc = 2 Then
iF Session("respuesta") = true Then Session("respuesta") = false Else Session("respuesta") = true
Session("inicial") = false
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>
.:Mensajes Para Alumnos:.
</title>

<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script language="javascript" src="js/Google_Javanew.js" type="text/javascript"></script>
<link href="beta2as.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="js/swfobject.js"></script>
</head>

<body style="font-size: 12px">

<%
CALL Conecta()

strSQL15 = "select * from cat_periodo where activado = 1"
'response.Write (strSQL15)
'response.End
set rs15 = Conn.Execute(strSQL15)
periodo = rs15("idperiodo")

%>
<!-- Start of Order Cards -->

<div id="order_cardas1" style="width: 730px;" align="center">
<%if Session("inicial") = true then %>
<div style="width:700px; height:auto;" align="left">
<%
strSQL3 = "exec listadecontactos " & session("maestro")
set rs3 = Conn.execute(strSQL3)
%>
<form action="insmensajeforo.asp?periodo=<%=periodo%>" method="post" name="insert">
<p style="font-family:Arial Black; font-size:12px;">En este Apartado podrás mandar mensajes a tus distintos tutorados.</p>
<table width="100%" cellpadding="0">
<tr>
<td style="vertical-align:top; width: 150px;">
<div style=" border-right:#ffffff 1px solid; height:250px; width:150px; font-family:Arial Black;">
<table border="0" width="100%" style="text-align:left; font-size:12px;">
<tr valign="top">
<td>
<div style="text-align:center; background-color:#CCCCFF;"><br />Mensajes.<br /><br /></div>
<br />
<div class="vincmunudiv"><a href="profesor.asp?idc=4">Del Departamento </a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeforo2.asp">Recibidos </a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeforo.asp">Enviados</a></div></td>
</tr>
<tr>
<td><div class="vincmunudiv"><a href="mensajeprofe.asp?idc=1">Escrivir Mensaje</a></div></td>
</tr>
</table>
</div>
</td>
<td>
<div>

<table border="0" width="100%">
<tr>
<td colspan="2" style="padding:10px;">
&nbsp;<b> Seleccione los alumnos a los que Quiere mandar el mensaje</b></td>
</tr>
<%
do until rs3.eof
%>
<tr>
<td colspan="2" style="padding:10px;">

<input id="chk<%=Rs3("matricula")%>" type="checkbox" name="chk<%=Rs3("matricula")%>" value="1" <%iF selec = true Then response.write("checked=""checked""") %> />
<%=rs3("alumno")%>
</td>
</tr>
<%
rs3.movenext
loop
%>
<tr>
<td colspan="2" style="padding:10px;">
<br />
&nbsp; <b>Titulo del Mensaje</b><br />
<input id="titulo" style="width:364px" type="text" name="titulo" maxlength="50" /><br />
<br />
&nbsp; <b>Mensaje.</b></td>
</tr>
<tr>
<td style="height: 40px; padding:10px;" colspan="2">
<textarea id="mensaje" name="mensaje" cols="550px" rows="120px" style="width: 500px; height: 120px"></textarea></td>
</tr>
<tr>
<td style="height: 24px" colspan="2">
<input id="insert" name="insert" type="submit" value="Guardar" /></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</div>
<%end if %>
</div>
<%CALL Desconecta()%>

</div>

</body>
</html>
  #9 (permalink)  
Antiguo 03/12/2008, 21:51
Avatar de killerangel  
Fecha de Ingreso: septiembre-2007
Ubicación: Un punto en el espacio
Mensajes: 592
Antigüedad: 16 años, 7 meses
Puntos: 10
Respuesta: como hacer un checkbox que seleccione todos

No se el resto pero yo no he mirado todo ese code q has colocado....

Si tan solo usaras fameworks sería todo en una sola linea como :

$(":check").attr("checked","checked"),;

.. claro, con JQuery...
__________________
Sueñen... y trabajen por hacer esos sueños realidad... de eso se construye el futuro!!
Me siento entre la ASP-ada y la PHP-red
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:47.