asi tengo la estructura de mi asp, para que se den una idea de como esta y ver si tengo algo mal.
paginainicial.asp
<html>
<head>
Código:
<script language="javascript" type="text/javascript">
var imagen = ""
//"<img src='ajax-loader.gif'/>"
function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) { xmlhttp = false; }
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) { xmlhttp = false; }
}
return xmlhttp;
}
var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest
function Busqueda(dato) {
if (!enProceso && http) {
var valor = escape(document.getElementById(dato).value);
//deberas cambiar esta parte y escribir la pagina correcta
var url = "buscador.asp?Find="+ valor;
http.open("GET", url+ "&raw=" + Math.random(), true);
http.onreadystatechange = handleHttpResponse;
enProceso = true;
http.send(null);
}
}
function handleHttpResponse(){
if (http.readyState==1){document.getElementById("respuesta").innerHTML = imagen;}
if (http.readyState == 4){
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1){
document.getElementById("respuesta").innerHTML = "";
// Armamos un array, usando la coma para separar elementos
results = unescape(http.responseText);//.split(","));
//Estos campos debes cambiarlos a los que tienes en tu formulario
document.getElementById("respuesta").innerHTML = results;//[0];
enProceso = false;
}
}
else
{
document.getElementById("respuesta").innerHTML = "";
mensaje = unescape(http.responseText);//.split(",");
document.getElementById("respuesta").innerHTML = mensaje;
enProceso = false;
}
}
}
function Mtdos(idCapa)
{
alert("entra a la funcion");
document.getElementById('metodo').value=idCapa.value;
alert("sigue el submit");
document.form1.submit();
alert("ya hizo el submit");
}
</script>
</head>
</head>
<body>
Código:
<form method="post" action="sistemas.asp" id="form1" name="form1">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td>Número de Sistema: <br /><span class="dtobligatorio"> * </span>
<input name="sistemas" type="text" id="sistemas" value="" size="20" maxlength="20" onchange="mostrarbtnguardar()" onblur="Busqueda(this.id)" />
<input name="ver" type="image" id="ver" value="ver" src="Images/20_VER1.jpg" /> </td></tr>
<tr><td>Nombre del sistema: <br /><span class="dtobligatorio"> * </span>
<input name="nombre" type="text" id="nombre" value="" size="95" maxlength="30" />
</td>
</tr>
<tr><td>Línea de sistemas:<br /><span class="dtobligatorio"> * </span>
<input name="linea" type="text" id="linea" value="" size="95" maxlength="30"/>
</td></tr>
<tr><td>
<input name="Guardar" type="image" id="Guardar" src="images/GUARDAR1.gif" style=" visibility: hidden;" onclick="Mtdos(this.id)" />
<input name="Modificar" type="image" id="Modificar" src="images/modificar1.gif" style=" visibility:hidden;" />
<input name="Borrar" type="image" id="Borrar" src="Images/ELIMINAR1.gif" style=" visibility: hidden;" />
<input type="image" src="images/IMPRIMIR1.gif" name="Imprimir" id="Imprimir" style=" visibility: hidden;" />
<input type="hidden" id="metodo" name="metodo" />
</td> </tr>
<div id="respuesta"></div>
</table>
</form>
</body>
pagina buscador.asp:
Código:
<!-- #include file="../conexion.asp" -->
<%
function buscar(sistema)
call conectarDB
Dim sSQL, rs
sSQL = "Select sistemas_id, sistemas_nombre, sistemas_linea FROM DS_Sistemas where sistemas_id = '"& sistema &"'"
Set rs = cnn.execute(sSQL)
if Err=0 then
%>
<tr><td>
<table align="left">
<tr>
<%
if not rs.eof then
c2 = rs.fields("sistemas_nombre").value
c3 = rs.fields("sistemas_linea").value %>
<td width="167"><input name="Modificar" type="image" id="Modificar" src="images/modificar1.gif" style=" visibility:visible;" /></td>
<td width="159"><input name="Borrar" type="image" id="Borrar" src="Images/ELIMINAR1.gif" style=" visibility: visible;" /></td>
<td width="72"><input type="image" src="images/IMPRIMIR1.gif" name="Imprimir" id="Imprimir" style=" visibility: visible;" /></td>
</tr>
<% else
'response.Write("Nombre: " &c2& " , Linea: " &c3)
'<input name="Modificar" type="image" id="Modificar" src="images/modificar1.gif" style=" visibility:visible;" onclick="window.open('consutasistema.asp','')" />
%>
<td width="167" height="36"><input name="Guardar" type="image" id="Guardar" src="images/GUARDAR1.gif" style=" visibility: visible;" onclick="Mtdos(this)" /></td>
<% end if %>
<input type="hidden" id="metodo" name="metodo" />
</table>
</td></tr>
<%end if
call desconectarDB
end function
criterio = request.querystring("Find")
if criterio <> "" then
call buscar(criterio)
else
valores="La consulta no puede realizarse si no escribe algo, por favor<br/>"
'response.Write valores
end if
%>
los botones que estan en la validacion de que si existe el registro y que despliegue los botones de modifica, eliminar e imprimir,.. esos me aparecen arriba de mi formulario
que sea??