Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/04/2005, 14:22
Avatar de skatomundo
skatomundo
 
Fecha de Ingreso: junio-2002
Ubicación: Santiago - CL
Mensajes: 2.532
Antigüedad: 22 años, 10 meses
Puntos: 125
pasando un Request.form("rutvalor") desde el formulario o submit

luego hago call a la funcion:

ESO ME FUNCIONO A MI...

CHEK LaDY


Código:
<form action="rut.asp?inicio=1" method="post">
<input name="rut" type="text">
<input name="A" type="submit" value="Ver Digito">
</form>
<%
if request.QueryString("inicio") = 1 then
 call codigo_veri(request.Form("rut"))
 Function codigo_veri(rut) 
	rut = request.Form("rut")
	tur = strreverse(rut)
	mult = 2 
	
	for i = 1 to len(tur) 
		if mult > 7 then 
			mult = 2 
		end if 
			suma = mult * mid(tur,i,1) + suma 
			mult = mult +1 
	next 
	
	valor = 11 - (suma mod 11) 
	
	if valor = 11 then 
		codigo_veri2 = "0"
	elseif valor = 10 then 
		codigo_veri2 = "k" 
	else 
		codigo_veri2 = valor 
	end if 
	response.Write("El rut Conformado: " & rut &"-"& codigo_veri2)
 end function 
 
end if
%>