Função em ASP para ser chamada no evendo onchange
Pessoal, por que essa minha função não está funcionando?
Sou novato na area e vou fazendo minhas gambiaras.
Function PesqMatricula(Campo)
varMatricula = campo
varSQL="SELECT EMPREGADOS.NOME, tbList_Coord.nome_coord " &_
"FROM EMPREGADOS INNER JOIN tbList_Coord ON EMPREGADOS.IDSUPERV = tbList_Coord.login_coord COLLATE SQL_Latin1_General_CP1_CI_AS " &_
"WHERE LOGIN='"& varMatricula &"' "
Set rsC = Server.CreateObject("ADODB.Recordset")
rsC.open varSQL,varConSIOUV,3,1
If NOT rsC.EOF OR NOT rsC.BOF Then
varNomeOp= rsC("NOME").value
varNomeSp= rsC("nome_coord").value
%>
<script LANGUAGE="JavaScript">
document.frmCadastro.txtNomeOp.value = <%=varNomeOp%>;
document.frmCadastro.txtNomeSp.value = <%=varNomeSp%>;
</script><%
End If
rsC.close
set rsC=nothing
varSQL=""
End Function
<input name="txtMatricula" type="text" class="Arial9_CZE1" id="txtMatricula" size="10" maxlength="7" onChange="PesqMatricula(this);">
Discussão (4)
Carregando comentários...