
05/01/2006, 12:23
|
| | Fecha de Ingreso: enero-2006
Mensajes: 9
Antigüedad: 19 años, 3 meses Puntos: 0 | |
Código Este es parte del código. FORMULARIO PRINCIPAL
<form method="POST" name="form1" action="validarCampo.asp?usuario=<%=usuario%>&ntip o=<%=ntipo%>&tipousu=<%=tipousu%>">
<table width="775" border="0">
<tr>
<td width="800"><div align="right" class="Estilo19">
<p> Usuario: <%=usuario%></p>
</div></td>
</tr>
<tr>
<td><div align="right" class="Estilo19">Perfil: <%=ntipo%></div></td>
</tr>
</table>
<br>
<table width="558" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td width="101">Código</td>
<td width="200"><input name="txtCoCodigo" type="text" size="4" maxlength="4" onBlur="Submit()" svalue="<%=mcodigo%>" ></td>
<td width="73">Septor</td>
<td width="184"><span class="negritas">
<select name="cboSeptor" class="listasycampos" style="width:180px">
<option value="00" selected>Seleccione</option>
<%
Set Db = Server.CreateObject ("ADODB.Connection")
Db.Open Application("WebConnectionString")
set RSBus = CreateObject("ADODB.Recordset")
SQL= "Select * FROM ORIC_Septor order by Se_Codigo"
RSBus.Open SQL, Db
if not RSBus.EOF then
While not RSBus.EOF%>
<option value="<%=Trim(RSBus.Fields("Se_Codigo"))%>"><%=Tr im(RSBus.Fields("Se_Descripcion"))%></option>
<% RSBus.MoveNext
Wend
end if
RSBus.Close
'Db.Close
%>
</select>
</span></td>
</tr>
<tr>
<td class="negritas"> </td>
<td colspan="3"> </td>
</tr>
<tr>
****** FORMULARIO VALIDAR CAMPO
<%
Dim Rs
Set RS = Server.CreateObject ("ADODB.Recordset")
sqlstr = "Select * From ORIC_Cooperadores Where CoCodigo = '" & request(TRIM("txtCoCodigo")) & "'"
RS.Open sqlstr,DB
if not Rs.eof then
mcodigo = request(TRIM("txtCoCodigo"))%>
<script language="javascript">
alert("El código ya existe, por favor ingrese nuevo código");
document.location.href="Cooperdores.asp?usuario=<% =usuario%>&ntipo=<%=ntipo%>&tipousu=<%=tipousu%>&t xtCoCodigo=<%=mCodigo%>"
</script>
<%end if
Rs.Close
%> |