Ir para conteúdo
Fórum Script Brasil
  • 0

Busca Em Outra Janela


Guest Help-me

Pergunta

alguém.. por favor tem ou sabe onde tem um exemplo de como abrir um pop-up para fazer uma busca em uma tabela e retornar o resultado desta busca para a um determinado campo da janela principal.

Sou inteiramente Leigo.. com exemplos´fica mais facil.

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

ficaria assim

<html>

<head>

<title>Java + Java</title>

</head>

<body bgcolor="#FFFFFF" link="#000000" vlink="#000000"

alink="#000000" <!--content start-->

<table border="0" cellpadding="5" cellspacing="5" width="96%">

<tr>

<td width="100%"><p align="center">

<font color="000000" face="verdana, Times New Roman, Times, serif" size="2pt">Esse

Script é um pequeno Sistema de Busca q você pode<br>

colocar em Seu Web Site. Para adicionar os links você

precisa<br>

mexer no código fonte. Mas é muito legal... Para Testar,<br>

digite <strong>java</strong> no Campo de Formulário

abaixo<br>

</font><script language="JavaScript"><!--

// Hide Script from Old Browsers

/*

Optimized by Daniel Bergman [http://botw.cjb.net].

Java Search Engine

©1997 Adam ALLEN.

Version 2.0

You may use this search engine on your page, but keep this

notice intact, and at the bottom of leave the Copyright notice at

the bottom of this page.

This scripts is my property, so please honnour my requests,

If you do so, you may freely copy, distribute, give this scripts

But it will FOREVER REMAIN MY PROPERTY.

This is the first Java Script that I have wrote, and am proud of it,

I feel pleased that I can contribute back to the bank of JavaScripts

that I have used on my page from other people, AN EYE FOR AN EYE!

*/

Keyword = new Object();

Descrip = new Object();

Address = new Object();

// Keyword[0] = n (where n is the number of keywords which can be searched

Keyword[0] = 6

// Each entry is split into

// Keyword[n] = text (where text is the keyword of which the entry is to

// be searched by (type Keywords in lowercase)

// Descrip[n] = text (where text is the description associated to this entry

// Address[n] = text (where text is the URL associated to the entry

// n is the entry number.

Keyword[1] = "java"

Descrip[1] = "Java + Java - Scripts e Applets em Java, Apostilas, totalmente grátis!"

Address[1] = "http://www.javamaisjava.hpg.com.br"

Keyword[2] = "java"

Descrip[2] = "Java + Java - Apostilas sobre Java Scripts e Applets e muito mais!"

Address[2] = "http://www.javamaisjava.hpg.com.br"

Keyword[3] = "free"

Descrip[3] = "Your site can go here!"

Address[3] = "ttp://www.yoursite.com"

Keyword[4] = "free"

Descrip[4] = "Your site can go here!"

Address[4] = "http://www.yoursite.com"

function checkDatabase() {

var Found = false

var Item = document.forms[0].searchfor.value.toLowerCase();

stats='toolbar=no,location=no,directories=no,status=no,menubar=no,height=300,width=300,'

stats += 'scrollbars=yes,resizable=yes'

MsgBox = window.open ("","msgWindow",stats)

MsgBox.opener = window;

MsgBox.opener.name = "opener";

MsgBox.document.write("<head><title>Resultado da Busca</title></head>");

MsgBox.document.write ("<body bgcolor=white text=black link=blue vlink=darkblue alink=blue><H2><CENTER><font face=arial>Resultado da Busca</CENTER></H2>")

MsgBox.document.write ("<font size=3><b><center>Busca por : "+Item+"</center><hr width=50%></b></font>");

for (var i=1; i <= Keyword[0]; i++) {

if(Item == Keyword) {

Found = true;

MsgBox.document.write ("<li><font color=arial><font size=2><b>"+Descrip+"<BR><A HREF="+Address+" target='opener'>Click Aqui para Acessar</A></font></font>")

}

}

if(!Found)

MsgBox.document.write ("<H4>Nenhuma Ocorrência</H4>")

// Leave the line below intact if you want to legally use this script

MsgBox.document.write ("<FORM><CENTER>")

MsgBox.document.write ("<font size=2><font color=arial><INPUT type='button' value='Fechar' onClick = 'self.close()'></font>")

MsgBox.document.write ("</CENTER></FORM>")

MsgBox.document.write ("<H6><small><small><small><b></b><font color=white><font face=arial><font size=1><font color=black>Java + Java Sistema de Busca <br>© 2001 All Rights Reserved</font></font></small></small></small>")

// There must be my notice above if you are to use this script legally.

// It took many hours work, fairs is fair, I just want that little line in

// and you get a fully working Search ENGINE, for FREE, on your site

// In Java Scripts as well, and not crap JAVA!

// Also a copyright notice MUST appear with the form.

}

// --></script></p>

<form name="form1">

<p align="center"><font color="000000" face="verdana, Times New Roman, Times, serif" size="2pt"><b>Procurar por:</b><br>

<input type="text" size="20" name="searchfor"><b><input

type="button" value="Procurar" align="absmiddle"

onclick="checkDatabase()"></b><br>

<br>

</font>

<font color="000000" face="verdana, Times New Roman, Times, serif" size="2pt">Para Testar,

procure por java</font></p>

</form>

</td>

</tr>

</table>

<!--content stop-->

<form>

<p align="center"><font color="#000000"><input type="button"

name="button" value="Código Fonte"

onclick="window.location = &quot;view-source:&quot; + window.location.href">

</font></p>

</form>

<p align="center">

<font color="000000" face="verdana, Times New Roman, Times, serif" size="2pt"><b>Java + Java</b></font></p>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

  • 0
Guest Help-me

não é bem isto.. seria para abrir uma Tabela e retornat o resultado desta tabela para um campo text da pagina que a chamou.

este que passou.. muito bom por sinal, é para pesquisa no proprio Site..

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...