Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/05/2012, 14:06
ariochy11053
 
Fecha de Ingreso: agosto-2011
Ubicación: Cuba, Pinar del Río
Mensajes: 82
Antigüedad: 12 años, 8 meses
Puntos: 0
Respuesta: almacenar valores de radio de un formulario y pasarlos a otro formulario g

jotaincubus, mis radios en su atributo name tienen este nombre m_$num_preg, por lo que la cuestion es que no se como referirme a ellos. te pongo parte de mi codigo del primer formulario donde genero los radios:

Código PHP:
Ver original
  1. $sql1="select num_preg, preg_percep from preguntas where id_aspecto='$mrow->id_aspecto'";
  2.           $result1=mysql_query($sql1,$link);
  3.          
  4.           while ($mrow1=mysql_fetch_object($result1)){
  5.            //$id_pregunta   =$mrow1->id_pregunta;
  6.            $num_preg    =$mrow1->num_preg;
  7.            $preg_percep =$mrow1->preg_percep;
  8.            echo "<tr>";
  9.            echo "<td>$num_preg<input type='hidden' name='n_$num_preg' value='$num_preg'></td>";
  10.            echo "<td align='left'>$preg_percep<input type='hidden' name='p_$num_preg' value='$num_preg'></td>";
  11.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='1' tabindex='2'></td>";
  12.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='2' tabindex='2'></td>";
  13.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='3' tabindex='2'></td>";
  14.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='4' tabindex='2'></td>";
  15.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='5' tabindex='2'></td>";
  16.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='6' tabindex='2'></td>";
  17.            echo "<td align='center'><input type='radio' name='mk_$num_preg' value='7' tabindex='2'></td>";                 
  18.            echo "</tr>";

y este e la otra parte del otro formulario donde quiero que aparescan los valores de los radios que seleccione y que además tengo otros radios:

Código PHP:
Ver original
  1. $sql1="select num_preg, preg_expec from preguntas where id_aspecto='$mrow->id_aspecto'";
  2.           $result1=mysql_query($sql1,$link);
  3.           while ($mrow1=mysql_fetch_object($result1)){
  4.            //$id_pregunta   =$mrow1->id_pregunta;
  5.            $num_preg    =$mrow1->num_preg;
  6.            $preg_expec  =$mrow1->preg_expec;           
  7.            echo "<tr>";
  8.            echo "<td>$num_preg<input type='hidden' name='n_$num_preg' value='$num_preg'></td>";
  9.            echo "<td align='left'>$preg_expec<input type='hidden' name='p_$num_preg' value='$num_preg'></td>";
  10.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='1' tabindex='2'><input type='text' style='width:55px' name='mk_$num_preg' value='[COLOR="Red"][B]como pongo aqui el valor del radio que fue enviado[/B][/COLOR]'></td>";
  11.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='2' tabindex='2'></td>";
  12.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='3' tabindex='2'></td>";
  13.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='4' tabindex='2'></td>";
  14.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='5' tabindex='2'></td>";
  15.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='6' tabindex='2'></td>";
  16.            echo "<td align='center'><input type='radio' name='m_$num_preg' value='7' tabindex='2'></td>";                  
  17.            echo "</tr>";
  18.           }