Mostar uma página resultante de pesquisa dentro da página de chamada
Boa tarde,
desenvolvi uma página onde há uma caixa de texto e dois botões (Título e Texto).
De acordo com o botão escolhido faço uma busca na tabela e mostra o resultado em uma tabela (table).
Funciona, mas está mostrando o resultado em outra página.
Gostaria de saber como faço para mostrar na mesma página mas logo abaixo desta caixa de texto e destes 2 botões, desta maneira, o usuário poderá fazer uma nova pesquisa sem precisar voltar.
Segue abaixo o código da página:
<?php require "verifica_sessao.php"; // Inicia sessão session_start(); ?><!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=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript"> <!--// common functions // We keep here the state of the search boxsearchIsDisabled = false; function searchChange(e) { // Update search buttons status according to search box content. // Ignore empty or whitespace search term. var value = e.value.replace(/\s+/, ''); if (value == '' || searchIsDisabled) { searchSetDisabled(true); } else { searchSetDisabled(false); }} function searchSetDisabled(flag) { // Enable or disable search document.getElementById('fullsearch').disabled = flag; document.getElementById('titlesearch').disabled = flag;} function searchFocus(e) { // Update search input content on focus if (e.value == 'Pesquisar') { e.value = ''; e.className = ''; searchIsDisabled = false; }} function searchBlur(e) { // Update search input content on blur if (e.value == '') { e.value = 'Pesquisar'; e.className = 'disabled'; searchIsDisabled = true; }} function actionsMenuInit(title) { // Initialize action menu for (i = 0; i < document.forms.length; i++) { var form = document.forms[i]; if (form.className == 'actionsmenu') { // Check if this form needs update var div = form.getElementsByTagName('div')[0]; var label = div.getElementsByTagName('label')[0]; if (label) { // This is the first time: remove label and do buton. div.removeChild(label); var dobutton = div.getElementsByTagName('input')[0]; div.removeChild(dobutton); // and add menu title var select = div.getElementsByTagName('select')[0]; var item = document.createElement('option'); item.appendChild(document.createTextNode(title)); item.value = 'show'; select.insertBefore(item, select.options[0]); select.selectedIndex = 0; } } }}//--></script> <script type="text/javascript"><!--// Initialize search formvar f = document.getElementById('searchform');f.getElementsByTagName('label')[0].style.display = 'none';var e = document.getElementById('searchinput');searchChange(e);searchBlur(e);//--></script><link href="css/interna.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style1 {font-weight: bold}--></style></head>
<body><div id="page_iframe"><div id="page_int"><div id="formulario"><div class="topico">Pesquisa de Produtos</div>
A página Visualiza_Pesquisa.php tem que mostrada logo abaixo dos botões<form action="Visualiza_Pesquisa.php" method="POST" name="frmBusca" target="_self" id="searchform"><div class="dados_pess"></div><div class="tit_categoria"> Produto</div><?php// Imprime mensagem de boas vindas echo "Bem-Vindo " . $_SESSION["usuario"] . "!<BR>\n";?><table width="390" border="1"> <tr> <th width="144" scope="col"> <input id="searchinput" type="text" name="txtprod" value="Pesquisar" size="20" onfocus="searchFocus(this)" onblur="searchBlur(this)" onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search"></th> <th width="230" align="left" valign="middle" scope="col"><span class="style1"> <label> <input name="titlesearch" type="submit" disabled="disabled" id="titlesearch" value="Títulos" /> <input name="fullsearch" type="submit" disabled="disabled" id="fullsearch" value="Texto"> </label> </span></th> </tr></table><br /><div id="botoes"></div></form><br /><br /><br /></div></div></div></body></html>
Grato,
Uelson
desenvolvi uma página onde há uma caixa de texto e dois botões (Título e Texto).
De acordo com o botão escolhido faço uma busca na tabela e mostra o resultado em uma tabela (table).
Funciona, mas está mostrando o resultado em outra página.
Gostaria de saber como faço para mostrar na mesma página mas logo abaixo desta caixa de texto e destes 2 botões, desta maneira, o usuário poderá fazer uma nova pesquisa sem precisar voltar.
Segue abaixo o código da página:
<?php require "verifica_sessao.php"; // Inicia sessão session_start(); ?><!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=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript"> <!--// common functions // We keep here the state of the search boxsearchIsDisabled = false; function searchChange(e) { // Update search buttons status according to search box content. // Ignore empty or whitespace search term. var value = e.value.replace(/\s+/, ''); if (value == '' || searchIsDisabled) { searchSetDisabled(true); } else { searchSetDisabled(false); }} function searchSetDisabled(flag) { // Enable or disable search document.getElementById('fullsearch').disabled = flag; document.getElementById('titlesearch').disabled = flag;} function searchFocus(e) { // Update search input content on focus if (e.value == 'Pesquisar') { e.value = ''; e.className = ''; searchIsDisabled = false; }} function searchBlur(e) { // Update search input content on blur if (e.value == '') { e.value = 'Pesquisar'; e.className = 'disabled'; searchIsDisabled = true; }} function actionsMenuInit(title) { // Initialize action menu for (i = 0; i < document.forms.length; i++) { var form = document.forms[i]; if (form.className == 'actionsmenu') { // Check if this form needs update var div = form.getElementsByTagName('div')[0]; var label = div.getElementsByTagName('label')[0]; if (label) { // This is the first time: remove label and do buton. div.removeChild(label); var dobutton = div.getElementsByTagName('input')[0]; div.removeChild(dobutton); // and add menu title var select = div.getElementsByTagName('select')[0]; var item = document.createElement('option'); item.appendChild(document.createTextNode(title)); item.value = 'show'; select.insertBefore(item, select.options[0]); select.selectedIndex = 0; } } }}//--></script> <script type="text/javascript"><!--// Initialize search formvar f = document.getElementById('searchform');f.getElementsByTagName('label')[0].style.display = 'none';var e = document.getElementById('searchinput');searchChange(e);searchBlur(e);//--></script><link href="css/interna.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style1 {font-weight: bold}--></style></head>
<body><div id="page_iframe"><div id="page_int"><div id="formulario"><div class="topico">Pesquisa de Produtos</div>
A página Visualiza_Pesquisa.php tem que mostrada logo abaixo dos botões<form action="Visualiza_Pesquisa.php" method="POST" name="frmBusca" target="_self" id="searchform"><div class="dados_pess"></div><div class="tit_categoria"> Produto</div><?php// Imprime mensagem de boas vindas echo "Bem-Vindo " . $_SESSION["usuario"] . "!<BR>\n";?><table width="390" border="1"> <tr> <th width="144" scope="col"> <input id="searchinput" type="text" name="txtprod" value="Pesquisar" size="20" onfocus="searchFocus(this)" onblur="searchBlur(this)" onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search"></th> <th width="230" align="left" valign="middle" scope="col"><span class="style1"> <label> <input name="titlesearch" type="submit" disabled="disabled" id="titlesearch" value="Títulos" /> <input name="fullsearch" type="submit" disabled="disabled" id="fullsearch" value="Texto"> </label> </span></th> </tr></table><br /><div id="botoes"></div></form><br /><br /><br /></div></div></div></body></html>
Grato,
Uelson
Uelson Cavalcante
Curtidas 0
Respostas
Leonardo Xavier
19/10/2010
voce ja resolveu este problema?
GOSTEI 0
José
19/10/2010
Este tópico esta sendo fechado por inatividade. Se necessário, sinalizar para que seja reaberto ou abrir um novo.
GOSTEI 0