Foros del Web » Programando para Internet » PHP »

PHP y Javascritp

Estas en el tema de PHP y Javascritp en el foro de PHP en Foros del Web. Hola tengo un problema muy grande y no sé porque no me funciona en php , si alguien me ayuda en poco tiempo le estare ...
  #1 (permalink)  
Antiguo 08/05/2011, 13:19
 
Fecha de Ingreso: junio-2010
Mensajes: 353
Antigüedad: 13 años, 10 meses
Puntos: 6
PHP y Javascritp

Hola tengo un problema muy grande y no sé porque no me funciona en php , si alguien me ayuda en poco tiempo le estare muy agredecido, tengo de tiempo hasta las 23 pero me he resignado porque tengo k hacer más trabajos.

Aquí va el código:

Esto esta en una clase llamada Constructor, y genero esto cuando llamo desde Index.html para que muestre un listado de productos sin stock de la base de datos, hasta aquí todo bien.
Después tengo 1 input text donde indico la cantidad de Stock que quiero cambiar del producto que he seleccionado con el radioButton y otro boton que envia a otra página esos valores mediante $_POST a otra página para ahí realizar el UPDATE en la base de datos.

Mediante javascript he echo que cuando clicke en radiobutton vaya ese valor a un input que despues lo envio por $_POST,

El problema es: que no va el javascript en la pagina php pero si que va en una pagina html... y he mirado y probado mil cosas yo me retiro ya xD si podeis ver el error series mis dioses

Código PHP:

function SelectStock(){
      
$Controlador = new Controlador();
        
$conexion $Controlador->ConexionBD();
          
$consulta "SELECT * FROM producto WHERE Stock = '0'";
         
$dataset mysql_query($consulta$conexion);



        
$html = <<<INICIO
   <html>

<head>
<LINK REL="stylesheet" TYPE="text/css" HREF="Contenido.css">
<link href="Elementos.css" rel="stylesheet" type="text/css">


   <script language=Javascript>
   
function inicializar(){
alert("hola");

document.getElementById("fila1").onclick = PonerPrecio;

alert("hola2");
}
function PonerPrecio(){
 var i=0;
    while (i!="ss"){
        if(document.getElementById("Radio"+i).checked){
            document.getElementById("idProducto").value = document.getElementById("p"+i).value;
            document.getElementById("Stock").value = document.getElementById("Stock"+i).value;
            break;}
        i+=4;
    }
    i=0
}


</script>
</head><body onload="inicializar()">
<div id="arriba">
SUPER TIENDA DE ORDENADORES ONLINE
</div>
<div id="arribaC">
SUPER TIENDA DE ORDENADORES ONLINE
</div>
<div id="contenidoCentroC">
<b><br>
 SUPER TIENDA DE ORDENADORES ONLINE
<br>

<br>
<title> SUPER TIENDA DE ORDENADORES ONLINE </title>

<center><table border =1 ><tr><td></td><td>idProducto </td><td>Nombre </td><td>Stock </td></tr>
    <form method="post" action="http://127.0.0.1:8888/Examen/MiniControladorBd.php">
INICIO;


        
$i=0;
        while (
$registro mysql_fetch_array($dataset)) {


            
$html $html . <<<INICIO
<tr id='fila1'>
INICIO;
             
$html $html "<td><input type ='radio' id='Radio$i' name='Importe'/><div style='display:none'><input id='p$i'value='".$registro['idProducto']."' /></div></td><td>" $registro['idProducto'] . "</td>";
            
$html $html "<td>" $registro['Nombre'] . "</td>";
            
$html $html "<td><div style='display:none'><input id='Stock$i'value='".$registro['Stock']."' /></div>" $registro['Stock'] . "</td>";
            
$i+=3;
            
$html $html . <<<INICIO
</tr>
INICIO;
        }

        
$html $html . <<<INICIO
            </table><br>
                <div style='display:none'><input id='Stock' name="Stock" value='' /></div>
                <div style='display:none'><input id='idProducto' name="idProducto" value='' /></div>
                <label for="enviarModificacion">Enviar Modificacion: </label>
<input id="enviarModificacion" name="enviarModificacion" value="" /> 

<input type="submit"id="submit" name="submit" value="nuevoStock" /></form></center>


INICIO;
        return 
$html;





Última edición por marcwolf; 08/05/2011 a las 13:25
  #2 (permalink)  
Antiguo 08/05/2011, 13:27
 
Fecha de Ingreso: junio-2010
Mensajes: 353
Antigüedad: 13 años, 10 meses
Puntos: 6
Respuesta: PHP y Javascritp

Borrar el tema XD, ja he descubierto el error omg que TONTO SOY

Etiquetas: javascript
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:05.