Ir para conteúdo
Fórum Script Brasil
  • 0

Botao Limpar


Lord Ninja

Pergunta

Olá a todos, gostaria de uma ajuda.

Tenho um gerador de tópicos para o meu site no qual tenho o seguinte trecho:

<tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" value="FileFactory" READONLY><img src=FileFactory.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" size="61" value="FilesFlash" READONLY><img src=FilesFlash.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" size="61" value="Minus" READONLY><img src=Minus.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" size="61" value="RapidGator" READONLY><img src=RapidGator.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" size="61" value="RapidShare" READONLY><img src=RapidShare.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Spoiler :</td>
                               <td><input name="spoiler[]" type="hidden" size="61" value="UploadEd" READONLY><img src=UploadEd.png /></td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Nome Link :</td>
                               <td width="54%" class=style1>
                                   <select id=nomelink[] size="1" name="nomelink[]">
                                           <OPTION value=Parte selected>Parte</OPTION>
                                   </SELECT>
                                   Agrupar: <input name="agrupalink[]" type="text" size="3" value="" READONLY></td>
                               </td>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <td width='50px'></td>
                               <td width='205px' class=style1>Links:</td>
                               <td class=style1 width=951 height=18><TEXTAREA name=link[] rows=10 cols=85></TEXTAREA></TD>
                               <td scope='col' width='30px'></td>
                           </tr>
                           <tr>
                               <th colspan=4> </th>
                           </tr>

Neste trecho tenho a variável link[] 6 vezes que depois eu processo em um código php, o meu drama é, queria criar um botão que limpasse somente o conteúdo que foi digitado nestes campos link[] que são um textarea

Tentei de varias formas mas não consegui, se alguém puder me ajudar...

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Supondo que a tabela que você postou tenha um ID (se não tiver, coloque algum).

function limpaAreas() {
    var areas = document.getElementById('id_da_tabela').getElementsByTagName('textarea');
    for (var i = 0; i < areas.length; i++) {
        areas[i].value = '';
    }
}
<input type='button' value='limpa' onclick='limpaAreas()'/>

:)

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,3k
×
×
  • Criar Novo...