Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/06/2011, 00:26
kamikaz
 
Fecha de Ingreso: mayo-2011
Mensajes: 8
Antigüedad: 13 años
Puntos: 0
Respuesta: pasar una variable javascript a una php, no se utilizar ajax

Gracias por tu ayuda, pero al final encontré la solucion al ver que la funcion similar_Text existe en javascript. este fue el cambio:

function creaSele(id, list, titulo){
document.getElementById(id).style.display='none';

sele = document.createElement('select');
sele.name ="lista[]";
sele.style.width = 400
var percent = 0;
<?
$idjuego = array_keys($array);
$i=0;
foreach($array as $x){?>

opt = document.createElement('option');
opt.innerHTML = unescape(<?echo "\"".addslashes($x)."\"";?>);
opt.value = <?echo "\"".$idjuego[$i]."\"";?>;
var porcentaje = similar_text("<?echo $x ;?>", titulo);
if(porcentaje > percent){
opt.selected = true;
percent = porcentaje;
}

opt.style.width = 400;
sele.appendChild(opt);
<?$i++;
}
?>
document.getElementById(list).appendChild(sele);
inpu = document.createElement('input');
inpu.type = 'hidden';
inpu.value = id;
inpu.name = "identificador[]";
document.getElementById(list).appendChild(inpu);
}