Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/03/2009, 14:48
doylelives
 
Fecha de Ingreso: junio-2008
Ubicación: Capital Federal xD
Mensajes: 1.208
Antigüedad: 15 años, 10 meses
Puntos: 35
Mmmmmhhhh sabes que me di cuenta que el <p></p> siguiente abarca desde el 2º select hasta el ultimo text que me borró???
Y resulta que los siguientes elementos que no borró estan fuera de ese parrafo!
Te pregunto porque no conozco el comportamiento de ajax lo aprendi muy por encima.
Codigo en cuestión:
Código PHP:
<p><span class="popupTitle"><strong>Categor&iacute;a 2</strong></span><strong>:</strong> 
                                  <? $sql_cat2 " SELECT * FROM category2 WHERE prev_cat = ".$_GET[cat1].
                                                     AND public = 1 ORDER BY cat_name ASC "
;
                                     
$res_cat2 mysql_query($sql_cat2);
                                     
//debbug echo $sql_cat2;
                                    
?>
                                  <br>
                                  <input name="cat2" type="hidden" value="<?=$_GET[cat2]; ?>">                                  
                                  <select disabled="disabled" name="select2" id="select2">
                                    <option value="0">Selecciona opci&oacute;n...</option>
                                  </select>
                                  <br><br>
                                  <span class="popupTitle"><strong>Categor&iacute;a 3 </strong></span><strong>:</strong>
                                  <? $sql_cat3 " SELECT * FROM category3 WHERE prev_cat = ".$_GET[cat2].
                                                     AND public = 1 ORDER BY cat_name ASC "
;
                                     
$res_cat3 mysql_query($sql_cat3);
                                     
//debbug echo $sql_cat3;
                                    
?>
                                  <br>
                                  <input name="cat3" type="hidden" value="<?=$_GET[cat3]; ?>">
                                  <select disabled="disabled" name="select3" id="select3">
                                    <option value="0">Selecciona opci&oacute;n...</option>
                                </select>
                                  <br>
                                  <br>
                                  <span class="popupTitle"><strong>Categor&iacute;a 4 </strong></span><strong>:</strong>
                                  <? $sql_cat4 " SELECT * FROM category4 WHERE prev_cat = ".$_GET[cat3].
                                                     AND public = 1 ORDER BY cat_name ASC "
;
                                     
$res_cat4 mysql_query($sql_cat4);
                                     
//debbug echo $sql_cat4;
                                    
?>
                                  <br>
                                  <input name="cat4" type="hidden" value="<?=$_GET[cat4]; ?>">
                                  <select name="filtrocat4" class="cat1" id="cat4" onChange="MM_jumpMenu('parent',this,10)">
                                    <option value="altaProducts.php?cat1=<?=$_GET[cat1];?>" selected>(ninguna)</option>
                                    <?
                                    
while ( $row_cat4 mysql_fetch_array($res_cat4) ) {
                                    
?>
                                    <option value="<? 
                                            
if ( $_GET[cat4] == $row_cat4[cat_id] ) {
                                                echo 
$row_cat4[cat_id];
                                            } else {
                                                echo 
'altaProducts.php?cat1='.$_GET[cat1].'&cat2='.$_GET[cat2].'&cat3='.$_GET[cat3].'&cat4='.$row_cat4[cat_id];
                                            }
                                            
?>"

                                            <?
                                            
if ( $_GET[cat4] == $row_cat4[cat_id] ) {
                                                echo 
'selected';
                                            }
?> title="<?=$row_cat4['cat_name'];?>">
                                    <?=substr($row_cat4['cat_name'],0,42);?>
                                    </option>
                                    <?
                                    
?>
                                  </select>
                                  <br>
                                  <br>
                                  <span class="popupTitle"><strong>Categor&iacute;a 5 </strong></span><strong>:</strong>
                                  <? $sql_cat5 " SELECT * FROM category5 WHERE prev_cat = ".$_GET[cat4].
                                                     AND public = 1 ORDER BY cat_name ASC "
;
                                     
$res_cat5 mysql_query($sql_cat5);
                                     
//debug echo $sql_cat5;
                                    
?>
                                  <br>
                                  <select name="cat5" class="cat1" id="cat5">
                                    <option value="" selected>(ninguna)</option>
                                    <?
                                    
while ( $row_cat5 mysql_fetch_array($res_cat5) ) {
                                        
?>
                                    <option value="<?=$row_cat5[cat_id]; ?>" title="<?=$row_cat4['cat_name'];?>"> <? echo substr($row_cat5['cat_name'],0,42); ?> </option>
                                    <?
                                    
?>
                                  </select>
                                  <br>
                                  <br>
                                  
                                  
                                  
                                   <strong>C&oacute;digo del Producto:</strong><br>
                                  <input name="code" type="text" id="code" size="20" maxlength="12">
                                  <br>                                  <br>                                  
                                  <strong>Nombre:</strong><br>
                                  <input name="name" type="text" id="name" size="45">
                                </p>

Please!! quedó del viernes jaja.
la propiedad responseText vuelca el contenido en el objeto select pero borra otros tags de html. Que tiene de especial ese parrafo <p> ? ya que todo su contenido desaparece misteriosamente?!

Última edición por GatorV; 17/03/2009 a las 09:50