• 0
Sign in to follow this  
ldrwebsite

Selecionar Todos Os Checkbox

Question

3 answers to this question

Recommended Posts

  • 0

<script>

function seleciona()

{

if (F1.master.checked==true)

for (cont=0; cont<F1.c1.length;cont++)

{

F1.c1[cont].checked=true

}

if (F1.master.checked==false)

for (cont=0; cont<F1.c1.length; cont++)

{

F1.c1[cont].checked=false

}

}

</script>

<body>

<form name="F1">

<input type=checkbox name="master" onclick="seleciona()"> <font face=verdana size=1>Selecionar Todos</font><br>

<input type=checkbox name="c1" value="1"><br>

<input type=checkbox name="c1" value="2"><br>

<input type=checkbox name="c1" value="3"><br>

<input type=checkbox name="c1" value="4"><br>

<input type=checkbox name="c1" value="5"><br>

<input type=checkbox name="c1" value="6"><br>

</form>

Share this post


Link to post
Share on other sites
  • 0
wink.gif Aí danyort, mas todos os checkbox tem que ter o mesmo nome? Porque no caso que vou usar cada checkbox tem que ter um nome diferente.

Share this post


Link to post
Share on other sites
  • 0
wink.gif E outra coisa, os valores de value sõa número contidos em um BD para que quando pedir para apagar, apague o registro com valor igual o do checkbox.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this