function is not defined

N

NightWalker

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&oacute;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.display =
"inline";
document.getElementById('divPromoventes').innerHTML =
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.selectedIndex].value
+ '&id=' + id;
enviaReq(valor);
return false;
}

function resultado() {
document.forms[<?php $_GET['id'];?>.promovente.value='<?php
$row[0];?>';
document.getElementById('divPromoventes').style.display='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?
 
D

david.parloir

hi NightWalker,
I got the same problem, with another function, but also AJAX.
Have you been able to solve it?
CU.
ledave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top