Hi, I'm having a little trouble with a javascript function that I
can't get to work but can't find the reason why.
I have the folowing code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="es-mx">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Captura de información de iniciativas</title>
<link href="css/udp.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 3px;
margin-top: 3px;
}
-->
</style>
</head>
<script language="javascript" src="scripts/calendario/calendar3.js"
type="text/javascript"></script>
<script language="javascript1.5" type="text/javascript">
function creaObjetoAjax() {
var obj;
var navegador = navigator.appName;
if (navegador == "Microsoft Internet Explorer") {
obj = new ActiveXObject("Microsoft.XMLHTTP");
} else {
obj = new XMLHttpRequest();
}
return obj;
}
var http = creaObjetoAjax();
function enviaReq(accion) {
http.open('get', accion);
http.onreadystatechange = manejaRespuesta;
http.send(null);
}
function manejaRespuesta() {
if (http.readyState == 4) {
document.getElementById('divPromoventes').style.di splay =
"inline";
document.getElementById('divPromoventes').innerHTM L =
http.responseText;
}
}
function buscaPromo(id) {
var valor = 'scripts/buscaPromo.php?busca=' +
document.getElementById(id).promovente.value + '&partido=' +
document.getElementById(id).partido.options[document.getElementById(id).partido.options.select edIndex].value
+ '&id=' + id;
enviaReq(valor);
return false;
}
function resultado() {
document.forms[<?php $_GET['id'];?>.promovente.value='<?php
$row[0];?>';
document.getElementById('divPromoventes').style.di splay='none';
}
</script>
<body>
<form id="capIniciativa" method="post" action="capIniciativas2.php">
<table width="780" border="0" cellpadding="0" cellspacing="0">
<tr class="tituloDocto">
<td colspan="3" align="center">Sistema de captura de
iniciativas</td>
</tr>
..
..
..
<label>Promovente:
<input name="promovente" type="text" size="40"
autocomplete="off" onkeyup="buscaPromo('capIniciativa');" /></label>
..
..
..
</body>
</html>
The problem is I get a "buscaPromo is not defined" error in Firefox
and an "object expected" error in IE, can anyone help?