Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Guest - Simone -

Formulário

Question

Guest - Simone -

<%

if aux="Alterar" then

resp="atualizar.asp?cod="& RS("cod")

else

resp="apagar.asp?cod="& RS("cod")

end if

%>

<form name="form" action="<%= resp%>" method="post">

<input name="aux" type="submit" value="Alterar"><br><br>

<input name="aux" type="submit" value="Excluir">

</form>

Tenho esse formulário e quero que quando o usuário aperte o botão Alterar vá para a página atualizar.asp e quando apertar Excluir vá para apagar.asp. Só que só está indo para apagar.asp, ou seja, ele esta procurando alguma várialvel aux ao invés de reconher o nome do botão como aux.

Por favor me ajudem!!!!!!!!!!!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Guest - Simone -
seu codigo é muito grande ?? posta ele inteiro

<%@LANGUAGE="VBSCRIPT"%>

<!--#include file="conexao.asp"-->

<html>

<head>

<title>Confira</title>

</head>

<body bgcolor="#FFFFCC" text="#990000" link="#cecece" alink="#FFFFFF" vlink="#cecece">

<hr>

<%

AbreConexao()

Set RS = Server.CreateObject("ADODB.Recordset")

RS.CursorType = adOpenKeyset

RS.Open "SELECT * FROM Aluno order by cod", Conexao

%>

<div align="center">

<table table align="center" bgcolor="#FFCC66"cellspacing="5" cellpadding="10" border="4" width="150">

<tr align="center">

<td align="center"> <h2>C&oacute;digo do Aluno</h2></td>

<td align="center"><h2>Nome</h2></td>

<td align="center"><h2>email</h2></td>

</tr>

<%

do while not RS.eof

%>

<tr>

<td><font size="2" face="Verdana"><%=RS("cod")%></font> </td>

<td><font size="2" face="Verdana"><%=RS("nome")%></font></td>

<td><font size="2" face="Verdana"><%=RS("email")%></font></td>

<td width="100">

<%

if aux="Alterar" then

resp="atualizar.asp?cod="& RS("cod")

else

resp="apagar.asp?cod="& RS("cod")

end if

%>

<form name="form" action="<%= resp%>" method="post">

<input name="<%= aux%>" type="submit" value="Alterar"><br><br>

<input name="<%= aux%>" type="submit" value="Excluir">

</form>

</td>

</tr>

<%

RS.movenext

loop%>

</table>

<form action="cadastro.htm" method="get">

<input type="submit" value="Novo Cadastro">

</form>

<%

FechaConexao()

%>

</div>

</body>

</html>

Share this post


Link to post
Share on other sites
  • 0

Tenta assim:

<% 
Dim Leva
if aux="Alterar" then
resp = "atualizar.asp?cod="& RS("cod")
Leva = Response.Redirect ("atualizar.asp?cod=")
else
resp = "apagar.asp?cod="& RS("cod")
Leva = Response.Redirect ("apagar.asp?cod=")
end if
%>

Falo!!!!!!!!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Cloud Computing


  • Forum Statistics

    • Total Topics
      148116
    • Total Posts
      643396
×
×
  • Create New...