Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2005
    Messaggi
    119

    [PHP]Passare i nomi di checkbox che vengono create dinamicamente

    Mi spiego meglio, qui viene creato la lista di checkbox:

    "
    <form id="id_form" method="post" action="modifica.php">
    <tr class="link record">
    <td>
    <input type="checkbox" id="row" name="row<?php echo"$i"; ?> " value="<?php echo"$array[id]"; ?> " onclick="Chked(this)"/>
    <input type="hidden" id="hdnChk" name="hdnChk<?php echo"$array[id]"; ?> " /></td>
    <td>
    <?php echo"$array[id]"; ?> </td>
    <td>
    " target="_blank">Immagine1</td>
    <td>
    [/COLOR] " target="_blank">Immagine2</td>
    <td>
    [/COLOR] " target="_blank">Immagine3</td>
    <td>
    [/COLOR] " target="_blank">Immagine4</td>
    <td width="160">
    <div id="corpo" class="testo">
    <?php echo"$array[testo]"; ?>
    </div></td>
    </tr> [/COLOR] <?php
    "

    Quando io chekko (si può dire? :master: ... vabbè) la cecbocs che voglio, vorrei riuscire, inviando tramite un pulsante submit, a ripescare il name della checkbox in esame... insomma non so cosa mettere in $_POST[ ] !!

  2. #2
    Utente di HTML.it L'avatar di luca200
    Registrato dal
    Apr 2002
    Messaggi
    4,120
    Invece di attaccare la variabile $i al nome 'row' mettila fra parentesi quadre (name="row[<?php echo"$i"; ?>]"), così crei un array di nome row e puoi ciclarlo con

    foreach ($_POST['row'])


    P.S. chekko non è bellissimo ma cecbocs è molto peggio

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2005
    Messaggi
    119
    Grazie capo! Molto obbligato

    P.S.: cecbocs rulla

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.