Hola a todos, tengo un porblema al querer llamar a funciones javascript desde mi archivo PHP.
Envío un ejemplo:
<?
$txt_barra = "Nombre Sección";
include ("config.php");
include ("funciones.php");
// INICIO CABECERA
include ("cabecera.php.inc");
...?>
El código de javascript lo llamo en el archivo cabecera.php.inc. Paso ejemplo de dicho archivo:
<html>
<head>
<title>Nombre del sitio - <?php echo $txt_barra; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Descripción aquí">
<meta name="keywords" content="xxxxx xxxxx,xxxx">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)==\"required\"){
if (((tempobj.type==\"text\"||tempobj.type==\"textare a\")&&tempobj.value=='')||(tempobj.type.toString() .charAt(0)==\"s\"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass) {
alert(\"No ha rellenado correctamente el formulario. Haga clic en Aceptar y corrija el/los error/es.\")
return false
}
else
return true
}
</script>
</head>
<body>
...
Es una función que verifica que los datos de un form estén completos.
El error me lo da en esta función y en todas las llamadas a código javascript.
¿Cuál podría ser el inconveniente?
Controlé con otros sitios y me funciona todo correcto.
Desde ya muchas gracias.