Foros del Web » Programando para Internet » ASP Clásico »

por que aparecen arriba los botones segun validacion?

Estas en el tema de por que aparecen arriba los botones segun validacion? en el foro de ASP Clásico en Foros del Web. 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> ...
  #1 (permalink)  
Antiguo 18/10/2007, 15:33
Avatar de Gaby_Corr  
Fecha de Ingreso: junio-2005
Mensajes: 672
Antigüedad: 19 años, 10 meses
Puntos: 0
por que aparecen arriba los botones segun validacion?

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??
__________________
" Recuerda , estas donde debes estar ..."
  #2 (permalink)  
Antiguo 18/10/2007, 15:36
Avatar de Shiryu_Libra
Colaborador
 
Fecha de Ingreso: febrero-2007
Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 18 años, 1 mes
Puntos: 88
Re: por que aparecen arriba los botones segun validacion?

gaby, integralos a la tabla, o creales una tabla independiente
__________________
"Eres parte del problema, parte de la solucion o parte del paisaje"
Un Saludo desde Desierto de Altar, Sonora, MX.
Shiryu_libra
  #3 (permalink)  
Antiguo 18/10/2007, 15:54
Avatar de Gaby_Corr  
Fecha de Ingreso: junio-2005
Mensajes: 672
Antigüedad: 19 años, 10 meses
Puntos: 0
Re: por que aparecen arriba los botones segun validacion?

pues los puse asi en una tabla, esta bien?... por que sigue sin aparecer debajo de los campos de mi formulario


Código:
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
     if rs.eof then%>
	 <table>
	<tr><td width="167" height="36"><input name="Guardar" type="image" id="Guardar" src="images/GUARDAR1.gif" style=" visibility: visible;" onclick="Mtdos(this)" /></td>
	<% else		
			
			c2 = rs.fields("sistemas_nombre").value
			c3 = rs.fields("sistemas_linea").value	%>	
		<table><tr>
		<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>
	<% end if %>
		  <input type="hidden" id="metodo" name="metodo" />  
	</tr>
</table>		
<%end if
call desconectarDB 
end function
__________________
" Recuerda , estas donde debes estar ..."
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:43.