Ir para conteúdo

POWERED BY:

Arquivado

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

pastoverdejante

Pequena alteração ASP

Recommended Posts

tenho este script e não consegui ajustar para que em vez de aparecer "selecione estado" seja visualizado um estado qualquer que eu determine

logo abaixo eu gostaria também de deixar ajustada a cidade para uma de minha escolha

 

algum amigo poderia me auxiliar?

 

<tr>

				<td height="25">

				<select name="Estado" class="ListBusca">

					<option selected>Selecione o estado</option>

					<% While Not objEstadosEsq.EOF %>

					<option value="<%=objEstadosEsq("Cod")%>"><%=objEstadosEsq("Estado")%></option>

					  <% objEstadosEsq.MOVENEXT : Wend %>
				</select>				</td>
			  </tr>

			  <tr>

				<td height="25"><input name="Cidade" type="text" class="TextBusca" onfocus="java script:this.value=''" value="Digite a cidade" /></td>
			  </tr>

			  <tr>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom Dia !

 

não li o código, mas já tentou com ajax ?

 

Abraços,

Vinicius Ianni

Segue o código abaixo amigo

 

 

<%

'------------------------------------------------------------------------------------------------------------------------------

Dim objEstadosEsq

Set objEstadosEsq = Conn.Execute("Select Cod, Estado from Estados order by Estado")

'------------------------------------------------------------------------------------------------------------------------------

DIM objSecoesEsq

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

objSecoesEsq.Open ("SELECT Cod, Secao FROM Secoes ORDER BY Secao"), Conn

'------------------------------------------------------------------------------------------------------------------------------

Dim DestaqueFoto1

Dim DestaqueFoto1Desativar

Dim DestaqueFoto2

Dim DestaqueFoto2Desativar

Dim DestaqueFoto3

Dim DestaqueFoto3Desativar

Dim DestaqueFotoValor

Dim DestaqueFotoTotal



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

	DestaqueFoto1.CursorType = 3

	DestaqueFoto1.Open("SELECT Cod, Foto1, BreveDescricao, NomeProduto FROM Anuncios WHERE CodLocal=3 AND Ativacao=1 AND Status=1 AND Foto1 <> '"&LocalFoto&"SemFoto.gif' AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"#"), Conn

		If not DestaqueFoto1.EOF Then

			DestaqueFotoTotal = DestaqueFoto1.RecordCount

			Randomize()

			DestaqueFotoValor = Int(Rnd * DestaqueFotoTotal)

			DestaqueFoto1.Move(DestaqueFotoValor)

		Else

			DestaqueFoto1Desativar = 1

			DestaqueFoto2Desativar = 1

			DestaqueFoto3Desativar = 1

		End If



If Not DestaqueFoto1Desativar = 1 Then

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

		DestaqueFoto2.CursorType = 3

		DestaqueFoto2.Open("SELECT Cod, Foto1, BreveDescricao, NomeProduto FROM Anuncios WHERE Cod <> "& DestaqueFoto1("Cod") &" AND CodLocal=3 AND Ativacao=1 AND Status=1 AND Foto1 <> '"&LocalFoto&"SemFoto.gif' AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"#"), Conn

			If not DestaqueFoto2.EOF Then

				DestaqueFotoTotal = DestaqueFoto2.RecordCount

				Randomize()

				DestaqueFotoValor = Int(Rnd * DestaqueFotoTotal)

				DestaqueFoto2.Move(DestaqueFotoValor)

			Else

				DestaqueFoto2Desativar = 1

				DestaqueFoto3Desativar = 1

			End If

End IF



If Not DestaqueFoto2Desativar = 1 Then

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

		DestaqueFoto3.CursorType = 3

		DestaqueFoto3.Open("SELECT Cod, Foto1, BreveDescricao, NomeProduto FROM Anuncios WHERE Cod <> "& DestaqueFoto1("Cod") &" AND Cod <> "& DestaqueFoto2("Cod") &" AND CodLocal=3 AND Ativacao=1 AND Status=1 AND Foto1 <> '"&LocalFoto&"SemFoto.gif' AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"#"), Conn

			If not DestaqueFoto3.EOF Then

				DestaqueFotoTotal = DestaqueFoto3.RecordCount

				Randomize()

				DestaqueFotoValor = Int(Rnd * DestaqueFotoTotal)

				DestaqueFoto3.Move(DestaqueFotoValor)

			Else

				DestaqueFoto3Desativar = 1

			End If

End IF

'------------------------------------------------------------------------------------------------------------------------------

Dim Destaque1

Dim Destaque1Desativar

Dim Destaque2

Dim Destaque2Desativar

Dim Destaque3

Dim Destaque3Desativar

Dim DestaqueValor

Dim DestaqueTotal

Dim SQLDestaque1

Dim SQLDestaque2

Dim SQLDestaque3



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

	Destaque1.CursorType = 3

	SQLDestaque1 = "SELECT Cod, BreveDescricao, NomeProduto FROM Anuncios WHERE CodLocal=4 AND Ativacao=1 AND Status=1 AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"#"

	If Not DestaqueFoto1Desativar = 1 Then

		SQLDestaque1 = SQLDestaque1 & " AND Cod <> " & DestaqueFoto1("Cod")

	End If

	If Not DestaqueFoto2Desativar = 1 Then

		SQLDestaque1 = SQLDestaque1 & " AND Cod <> " & DestaqueFoto2("Cod")

	End If

	If Not DestaqueFoto3Desativar = 1 Then

		SQLDestaque1 = SQLDestaque1 & " AND Cod <> " & DestaqueFoto3("Cod")

	End If

	Destaque1.Open SQLDestaque1, Conn

		If not Destaque1.EOF Then

			DestaqueTotal = Destaque1.RecordCount

			Randomize()

			DestaqueValor = Int(Rnd * DestaqueTotal)

			Destaque1.Move(DestaqueValor)

		Else

			Destaque1Desativar = 1

			Destaque2Desativar = 1

			Destaque3Desativar = 1

		End If



If Not Destaque1Desativar = 1 Then

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

		Destaque2.CursorType = 3

		SQLDestaque2 = "SELECT Cod, BreveDescricao, NomeProduto FROM Anuncios WHERE CodLocal=4 AND Ativacao=1 AND Status=1 AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND Cod <> " & Destaque1("Cod")

		If Not DestaqueFoto1Desativar = 1 Then

			SQLDestaque2 = SQLDestaque2 & " AND Cod <> " & DestaqueFoto1("Cod")

		End If

		If Not DestaqueFoto2Desativar = 1 Then

			SQLDestaque2 = SQLDestaque2 & " AND Cod <> " & DestaqueFoto2("Cod")

		End If

		If Not DestaqueFoto3Desativar = 1 Then

			SQLDestaque2 = SQLDestaque2 & " AND Cod <> " & DestaqueFoto3("Cod")

		End If

		Destaque2.Open SQLDestaque2, Conn

			If not Destaque2.EOF Then

				DestaqueTotal = Destaque2.RecordCount

				Randomize()

				DestaqueValor = Int(Rnd * DestaqueTotal)

				Destaque2.Move(DestaqueValor)

			Else

				Destaque2Desativar = 1

				Destaque3Desativar = 1

			End If

End IF



If Not Destaque2Desativar = 1 Then

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

		Destaque3.CursorType = 3

		SQLDestaque3 = "SELECT Cod, BreveDescricao, NomeProduto FROM Anuncios WHERE CodLocal=4 AND Ativacao=1 AND Status=1 AND DataDe <= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND DataAte >= #"&Month(Date) & "/" & Day(Date) & "/" & Year(Date) &"# AND Cod <> " & Destaque1("Cod") & " AND Cod <> " & Destaque2("Cod")

		If Not DestaqueFoto1Desativar = 1 Then

			SQLDestaque3 = SQLDestaque3 & " AND Cod <> " & DestaqueFoto1("Cod")

		End If

		If Not DestaqueFoto2Desativar = 1 Then

			SQLDestaque3 = SQLDestaque3 & " AND Cod <> " & DestaqueFoto2("Cod")

		End If

		If Not DestaqueFoto3Desativar = 1 Then

			SQLDestaque3 = SQLDestaque3 & " AND Cod <> " & DestaqueFoto3("Cod")

		End If

		Destaque3.Open SQLDestaque3, Conn

			If not Destaque3.EOF Then

				DestaqueTotal = Destaque3.RecordCount

				Randomize()

				DestaqueValor = Int(Rnd * DestaqueTotal)

				Destaque3.Move(DestaqueValor)

			Else

				Destaque3Desativar = 1

			End If

End IF

'------------------------------------------------------------------------------------------------------------------------------

%>

		<table width="135"  border="0" cellspacing="0" cellpadding="0">

		  <tr>

			<td height="13" background="Imagens/LinhaBarras.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

		  </tr>

		  <tr>

			<td>

			<table width="100%"  border="0" cellspacing="0" cellpadding="0">

			  <tr>

				<td><img src="Imagens/Pesquisa.gif" width="71" height="16"></td>

			  </tr>

			  <form action="Resultado.asp" method="get" name="Pesquisa">

			  <tr>

				<td height="25">

				<select name="Estado" class="ListBusca">

					<option selected>Selecione o estado</option>

					<% While Not objEstadosEsq.EOF %>

					<option value="<%=objEstadosEsq("Cod")%>"><%=objEstadosEsq("Estado")%></option>

					  <% objEstadosEsq.MOVENEXT : Wend %>

				</select>

				</td>

			  </tr>

			  <tr>

				<td height="25">

				  <input name="Cidade" type="text" class="TextBusca" onFocus="java script:this.value=''" value="Digite a cidade">

				</td>

			  </tr>

			  <tr>

				<td height="25"><select name="Secao" class="ListBusca">

				  <option selected>Escolha a Seção</option>

				  <% While Not objSecoesEsq.eof %>

					  <option value="<%=objSecoesEsq("Cod")%>"><%=objSecoesEsq("Secao")%></option>

				  <%

				  objSecoesEsq.movenext

				  Wend

				  %>

				</select></td>

			  </tr>

			  <tr>

				<td height="25"><input name="Palavra" type="text" class="TextBusca" value="O que deseja procurar?" onFocus="java script:this.value=''"></td>

			  </tr>

			  <tr>

				<td height="25" align="right"><input type="image" src="Imagens/BotPesquisar.gif" name="Enviar" value="Enviar"></td>

			  </tr>

			  </form>

			</table>

			</td>

		  </tr>

		  <tr>

			<td height="13" background="Imagens/LinhaBarras.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

		  </tr>

		  <tr>

			<td>

			<table width="100%" border="0" cellspacing="0" cellpadding="0">

			  <% If Not DestaqueFoto1Desativar = 1 Then %>

			  <tr>

				<td height="20" valign="top"><img src="Imagens/Destaques.gif" width="80" height="16"></td>

			  </tr>

			  <tr>

				<td align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto1("Cod")%>"><img src="<%=LocalFoto&DestaqueFoto1("Foto1")%>" width="120" border="0"></a></td>

				  </tr>

				  <tr>

					<td class="TituloCinzaMedio"><%=DestaqueFoto1("NomeProduto")%></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaMedio"><%=DestaqueFoto1("BreveDescricao")%></td>

				  </tr>

				  <tr>

					<td align="right" class="TextoAzulEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto1("Cod")%>" class="TextoAzulEscuro">saiba mais</a> <img src="Imagens/SetaSaibaMais.gif" width="4" height="5" border="0"></td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="18" background="Imagens/LinhaDestaques.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

			  </tr>

			  <%

				DestaqueFoto1.Close

				Set DestaqueFoto1 = Nothing

			  End If

			  If Not DestaqueFoto2Desativar = 1 Then

			  %>

			  <tr>

				<td align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto2("Cod")%>"><img src="<%=LocalFoto&DestaqueFoto2("Foto1")%>" width="120" border="0"></a></td>

				  </tr>

				  <tr>

					<td class="TituloCinzaMedio"><%=DestaqueFoto2("NomeProduto")%></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaMedio"><%=DestaqueFoto2("BreveDescricao")%></td>

				  </tr>

				  <tr>

					<td align="right" class="TextoAzulEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto2("Cod")%>" class="TextoAzulEscuro">saiba mais</a> <img src="Imagens/SetaSaibaMais.gif" width="4" height="5" border="0"></td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="18" background="Imagens/LinhaDestaques.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

			  </tr>

			  <%

				DestaqueFoto2.Close

				Set DestaqueFoto2 = Nothing

			  End If

			  If Not DestaqueFoto3Desativar = 1 Then

			  %>

			  <tr>

				<td align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto3("Cod")%>"><img src="<%=LocalFoto&DestaqueFoto3("Foto1")%>" width="120" border="0"></a></td>

				  </tr>

				  <tr>

					<td class="TituloCinzaMedio"><%=DestaqueFoto3("NomeProduto")%></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaMedio"><%=DestaqueFoto3("BreveDescricao")%></td>

				  </tr>

				  <tr>

					<td align="right" class="TextoAzulEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=DestaqueFoto3("Cod")%>" class="TextoAzulEscuro">saiba mais</a> <img src="Imagens/SetaSaibaMais.gif" width="4" height="5" border="0"></td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="18" background="Imagens/LinhaDestaques.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

			  </tr>

			  <%

				DestaqueFoto3.Close

				Set DestaqueFoto3 = Nothing

			  End If

			  If Not Destaque1Desativar = 1 Then

			  %>

			  <tr>

				<td height="18" align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td class="TituloCinzaEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=Destaque1("Cod")%>" class="TituloCinzaEscuro"><%=Destaque1("NomeProduto")%></a></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaEscuro"><%=Destaque1("BreveDescricao")%>...</td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="15" background="Imagens/LinhaDestaques.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

			  </tr>

			  <%

				Destaque1.Close

				Set Destaque1 = Nothing

			  End If

			  If Not Destaque2Desativar = 1 Then

			  %>

			  <tr>

				<td height="18" align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td class="TituloCinzaEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=Destaque2("Cod")%>" class="TituloCinzaEscuro"><%=Destaque2("NomeProduto")%></a></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaEscuro"><%=Destaque2("BreveDescricao")%>...</td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="15" background="Imagens/LinhaDestaques.gif"><img src="Imagens/blank.gif" width="1" height="1"></td>

			  </tr>

			  <%

				Destaque2.Close

				Set Destaque2 = Nothing

			  End If

			  If Not Destaque3Desativar = 1 Then

			  %>

			  <tr>

				<td height="18" align="center">

				<table width="120" border="0" cellspacing="0" cellpadding="0">

				  <tr>

					<td class="TituloCinzaEscuro"><a href="MaisAnuncio.asp?CodProduto=<%=Destaque3("Cod")%>" class="TituloCinzaEscuro"><%=Destaque3("NomeProduto")%></a></td>

				  </tr>

				  <tr>

					<td class="TextoCinzaEscuro"><%=Destaque3("BreveDescricao")%>...</td>

				  </tr>

				</table>

				</td>

			  </tr>

			  <tr>

				<td height="13" background="Imagens/LinhaBarras.gif"> </td>

			  </tr>

			  <% 

				Destaque3.Close

				Set Destaque3 = Nothing

				End If %>

			  <tr>

				<td height="20"><img src="Imagens/Newsletter.gif" width="91" height="16"></td>

			  </tr>

			  <tr>

				<td height="10" align="center">

				<table width="100%"  border="0" cellspacing="0" cellpadding="0">

				  <form action="Cadastro.asp" method="post" name="Cadastro">

					<tr>

					  <td class="TextoCinzaEscuro">Coloque seu e-mail para receber novidades ou excluí-lo de nossa lista.</td>

					</tr>

					<tr>

					  <td>

					  <table width="100%"  border="0" cellspacing="0" cellpadding="0">

						  <tr>

							<td width="14%"><input name="Acao" type="radio" value="1" checked></td>

							<td width="36%" class="TextoCinzaMedio">Cadastrar</td>

							<td width="14%"><input name="Acao" type="radio" value="2"></td>

							<td width="36%" class="TextoCinzaMedio">Remover</td>

						  </tr>

					  </table>

					  </td>

					</tr>

					<tr>

					  <td><input name="Email" type="text" class="Form13319"></td>

					</tr>

					<tr>

					  <td height="24" valign="bottom" align="right">

						<input name="imageField2" type="image" src="Imagens/Ok.gif" width="38" height="16" border="0">

					  </td>

					</tr>

				  </form>

				</table></td>

			  </tr>

			</table>

			</td>

		  </tr>

		</table>

<%



' finaliza/destroi os objetos

If isObject(objEstadosEsq) Then

objEstadosEsq.Close

Set objEstadosEsq = Nothing

End If

If isObject(objSecoesEsq) Then

objSecoesEsq.Close

Set objSecoesEsq = Nothing

End If



%>

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.