Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

formalivre

Update

Recommended Posts

olá pessoal.

tenho uma aplicação onde são escolhidas opções com radio buttons.

as informações são alteradas mas não ficam marcadas com a última alteração.

abaixo vou listar uma parte do script.

<%

Dim MM_editAction

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))

If (Request.QueryString <> "") Then

MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)

End If

 

' boolean to abort record edit

Dim MM_abortEdit

MM_abortEdit = false

%><%

' IIf implementation

Function MM_IIf(condition, ifTrue, ifFalse)

If condition = "" Then

MM_IIf = ifFalse

Else

MM_IIf = ifTrue

End If

End Function

%>

<%

If (CStr(Request("MM_update")) = "form1") Then

If (Not MM_abortEdit) Then

' execute the update

Dim MM_editCmd

 

Set MM_editCmd = Server.CreateObject ("ADODB.Command")

MM_editCmd.ActiveConnection = MM_conexao_STRING

MM_editCmd.CommandText = "UPDATE webflyer SET modelos = ? WHERE modelos = ?"

MM_editCmd.Prepared = true

MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 203, 1, 536870910, Request.Form("modelos")) ' adLongVarWChar

MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 200, 1, 255, Request.Form("MM_recordId")) ' adVarChar

MM_editCmd.Execute

MM_editCmd.ActiveConnection.Close

 

' append the query string to the redirect URL

Dim MM_editRedirectUrl

MM_editRedirectUrl = "admin.asp"

If (Request.QueryString <> "") Then

If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then

MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString

Else

MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString

End If

End If

Response.Redirect(MM_editRedirectUrl)

End If

End If

%>

<%

Dim RS

Dim RS_cmd

Dim RS_numRows

 

Set RS_cmd = Server.CreateObject ("ADODB.Command")

RS_cmd.ActiveConnection = MM_conexao_STRING

RS_cmd.CommandText = "SELECT * FROM webflyer"

RS_cmd.Prepared = true

 

Set RS = RS_cmd.Execute

RS_numRows = 0

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Administração do WeBFLYeR - <%=(RS.Fields.Item("titulo").Value)%></title>

<link href="modelo_adm.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="wysiwyg.js"></script>

</head>

 

<body>

<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">

<div id="tabelavoltar"><a href="admin.asp"><img src="imagens/voltar.gif" alt="voltar" border="0"/></a></div>

<div id="tabelageral">

<div id="tabelatopico">Altere o título do seu WeBFLYeR:</div>

<div id="tabelaformulario"><label><input type="radio" name="modelos" id="modelos" value="modelo_01.css" checked="<%= RS.Fields.Item("id").Value %>"/></label>Modelo 1</div>

<div id="tabelaformulario"><label><input type="radio" name="modelos" id="modelos" value="modelo_02.css" checked="<%= RS.Fields.Item("id").Value %>"/></label>Modelo 2</div>

<div id="tabelaformulario"><label><input type="radio" name="modelos" id="modelos" value="modelo_03.css" checked="<%= RS.Fields.Item("id").Value %>"/></label>Modelo 3</div>

 

<div id="tabeladescricao">Neste campo você digita um título para o seu WeBFLYeR.<br />

O título é importante para identificar seu WeBFLYeR.</div>

<div id="tabelabotao"><label><input type="hidden" name="MM_update" value="form1"/><input name="button" type="submit" class="formulario" id="button" value="Salvar alteração"/>

</label></div>

</div>

 

<input type="hidden" name="MM_recordId" value="<%= RS.Fields.Item("modelos").Value %>" />

</form>

</body>

</html>

<%

RS.Close()

Set RS = Nothing

%>

se alguém puder me ajudar para ficar gravado a alteração. obrigado desde já.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.