Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/02/2011, 05:36
nestorag1991
 
Fecha de Ingreso: noviembre-2010
Mensajes: 26
Antigüedad: 13 años, 5 meses
Puntos: 0
Problema entre javascript y php

Buenas, vereis, tengo un problema y es que cree un formulario con INNERHTML con un input dentro de una funcion javascript y ese formulario apunta a un archivo php.

El problema es que me da un error dificil de solventar, ya que dreamweaver no me dice que es un error de sintaxis, pero sin embargo, el parse error de php me dice que hay un error, que es el siguiente:

We selected 'Europe/Paris' for '1.0/no DST' instead in C:\Web\sesion.php on line 60 Notice: Undefined index: insertardeportes in C:\Web\sesion.php on line 60 Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in C:\Web\sesion.php on line 62 Fatal error: Call to undefined function alert() in C:\Web\sesion.php on line 62

Parte del codigo php:

insertardeportes es la id del input

Código PHP:
Ver original
  1. echo '<div align="right">';
  2.     echo "Este es el menu del usuario ". $_SESSION['nombre'] ."<br />\n";
  3.     echo 'Que quieres hacer?<br>
  4.     <strong><div id="capainsertar" style="cursor:pointer;" onClick="muestraformularioinsertar()">Insertar datos</div></strong>';
  5.     if ($_REQUEST['insertardeportes'] == "") //LINEA 60
  6.     {
  7.         alert("No has insertado nada en el campo deporte"); //LINEA 62
  8.     }
  9.    
  10.     echo '</div>';


Parte del codigo javascript:

Código Javascript:
Ver original
  1. function muestraformularioinsertar()
  2. {
  3.     if (document.getElementById("capainsertar").innerHTML.length == 14)
  4.     {
  5.         document.getElementById("capainsertar").innerHTML = "<FORM action=\"sesion.php\" id=\"insertardeportes\" onSubmit=\"borrarcapa(\"capainsertar\");\" >Dime el nombre de tu deporte favorito: <input type=\"text\" id=\"deporte\"> &nbsp <input type=\"submit\"> </FORM>";
  6.     }
  7. }
  8.  
  9. function borrarcapa(capa)
  10. {
  11.     document.getElementById(capa).innerHTML = "";
  12. }

Saludos.