Ir para conteúdo
Fórum Script Brasil

marvi

Membros
  • Total de itens

    860
  • Registro em

  • Última visita

Tudo que marvi postou

  1. marvi

    POP UP

    Esse eu conheço, mas aí em vez de chamar a função com onclick, eu quero chamar com onload e assim não vai... Por isso achei esse que vai com onload
  2. Pessoal é o seguinte, Eu tenho uma pagina mãe que abre uma POP UP e dentro dessa POP UP tem um iframe que tem um formulário. A pessoa cadastra e enviar e dar o resultado com a mensagem: “Enviado com sucesso”, isso tudo dentro do iframe que está dentro do POP UP, mas depois surgir o botão Fechar <a href="atualizarfabricantes.asp?msg=del"> <font color="#3A5278" style="font-size: 9pt; font-weight: 700; text-decoration:underline" face="Verdana">Fechar Janela</font></a> atualizarfabricantes.asp: <% msg1 = Request.QueryString("msg") if msg1 = "ata" then%> <script> opener.location.reload(); window.close(); </script> <%end if%> Mas aí ele não fecha POP UP e atualiza a pagina mãe não... Ele dar um erro e pronto. Antes esse código fechava a POP UP quando esses scripts não ficavam em um iframe do POP UP. Antes era só a pagina no POP e assim fechava... Agora com iframe a página não fecha. Por que? Obrigado!
  3. Pessoal, estou com o seguinte POP UP e ele roda muito bem, o que quero é saber se há uma maneira de inibir, desabilitar a barra azul que fica em cima da janela do POP UP, onde tem esse minimizar, restaurar e fechar com X, tem como ocultar ou desabilitar? Eu não quero freesncrenn, tela cheia, preciso de algo que desabilite essa barra azul superior da janela. E aproveitando, se souberem, queria que quando o POP UP abrisse na frente do site, o site atrás ficasse com uma cor escura, tem como? <script language="javaScript"> //FUNÇÃO PARA ABRIR UM POPUP DE FORMA MODAL EM TODOS OS NAVEGADORES ----------------------- function o(strURL, strArgument, intWidth, intHeight){ var intTop = ((screen.height - intHeight) / 2); var intLeft = ((screen.width - intWidth) / 2); var strEnderec=strURL; var strAjustesIE='status=0; help=0; center:yes; dialogWidth:'+intWidth+'px; dialogHeight:'+intHeight+'px'; var strAjustesNS='width='+intWidth+', height='+intHeight+', status=0, scrollbars=1, menubar=0, dependent=1, left='+intLeft+', top='+intTop; with (window.navigator){ switch (appName){ case 'Microsoft Internet Explorer': var x = window.showModalDialog(strEnderec, strArgument ,strAjustesIE); break; case 'Netscape': var x = window.open(strEnderec, 'Default', strAjustesNS); break; } } } //------------------------------------------------------------------------------------------------------------ </script> onLoad="o('quantidadefabricantes.asp', window, 680, 420);" Obrigado! Marcelo
  4. marvi

    Popup

    Mas esse http://sublog.subimage.com/articles/2006/0...;./subModal funciona só com onclick e não com onload... teste e veja
  5. marvi

    Popup

    Quero que o site site no fundo fique em um tom de cor escurecido sim. Achei esse: <script language="javaScript"> //FUNÇÃO PARA ABRIR UM POPUP DE FORMA MODAL EM TODOS OS NAVEGADORES ----------------------- function o(strURL, strArgument, intWidth, intHeight){ var intTop = ((screen.height - intHeight) / 2); var intLeft = ((screen.width - intWidth) / 2); var strEnderec=strURL; var strAjustesIE='status=0; help=0; center:yes; dialogWidth:'+intWidth+'px; dialogHeight:'+intHeight+'px'; var strAjustesNS='width='+intWidth+', height='+intHeight+', status=0, scrollbars=1, menubar=0, dependent=1, left='+intLeft+', top='+intTop; with (window.navigator){ switch (appName){ case 'Microsoft Internet Explorer': var x = window.showModalDialog(strEnderec, strArgument ,strAjustesIE); break; case 'Netscape': var x = window.open(strEnderec, 'Default', strAjustesNS); break; } } } //------------------------------------------------------------------------------------------------------------ </script> onLoad="o('quantidadefabricantes.asp', window, 680, 420);" Na verdade tem esse site: http://sublog.subimage.com/articles/2006/01/01/subModal que explica fazer Popup que bular o anti-popup, mas com ele não consigo fazer carregar com onload, só com onclick
  6. marvi

    Popup

    o exemplo que o Void postou lá, não acessa mais... Mas é isso que você disse, tanto faz onclick ou onload... mas é que no meu exemplo que te mostrei não esta fazendo com onload, disse que dar erro: objeto necessário..., mas quando coloco onlcick não dar erro nenhum...E como preciso com onload então queria resolver esse erro. Esses popup que você me passou lá é bloqueado pelo anti-popup? Preciso que não seja. Obrigado!
  7. marvi

    Popup

    Mas é esse popup que uso e ele só abre com onclick e não com onload... e quero com onload
  8. Olá pessoal, eu estava querendo um pop que travasse a página atrás e só tivessem acesso a página de trás quando fechassem o popup que está na frente. Achei esse aqui no forum: Para deixar mais claro, foi esse exemplo que usei: http://sublog.subimage.com/articles/2006/01/01/subModal Ou senão, veja os codigos abaixo: Só que o exemplo que me mostrou ele funciona com onclick, mas quando passo para onload ele da erro... Não abre, por que? <body topmargin="0" leftmargin="0" onload="showPopWin('modalContent.html', 400, 200, null);" > Index: <link rel="stylesheet" type="text/css" href="subModal.css" /> <script type="text/javascript" src="common.js"></script> <script type="text/javascript" src="subModal.js"></script> <button onclick="showPopWin('modalContent.html', 400, 200, null);">show modal window button</button> script commom: /** * COMMON DHTML FUNCTIONS * These are handy functions I use all the time. * * By Seth Banks (webmaster at subimage dot com) * http://www.subimage.com/ * * Up to date code can be found at http://www.subimage.com/dhtml/ * * This code is free for you to use anywhere, just keep this comment block. */ /** * X-browser event handler attachment and detachment * TH: Switched first true to false per http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html * * @argument obj - the object to attach event to * @argument evType - name of the event - DONT ADD "on", pass only "mouseover", etc * @argument fn - function to call */ function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventListener){ obj.removeEventListener(evType, fn, useCapture); return true; } else if (obj.detachEvent){ var r = obj.detachEvent("on"+evType, fn); return r; } else { alert("Handler could not be removed"); } } /** * Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/ * * Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com) * * Gets the full width/height because it's different for most browsers. */ function getViewportHeight() { if (window.innerHeight!=window.undefined) return window.innerHeight; if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight; if (document.body) return document.body.clientHeight; return window.undefined; } function getViewportWidth() { var offset = 17; var width = null; if (window.innerWidth!=window.undefined) return window.innerWidth; if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; if (document.body) return document.body.clientWidth; } /** * Gets the real scroll top */ function getScrollTop() { if (self.pageYOffset) // all except Explorer { return self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict { return document.documentElement.scrollTop; } else if (document.body) // all other Explorers { return document.body.scrollTop; } } function getScrollLeft() { if (self.pageXOffset) // all except Explorer { return self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollLeft) // Explorer 6 Strict { return document.documentElement.scrollLeft; } else if (document.body) // all other Explorers { return document.body.scrollLeft; } } Submodal: /** * SUBMODAL v1.5 * Used for displaying DHTML only popups instead of using buggy modal windows. * * By Seth Banks * http://www.subimage.com/ * * Contributions by: * Eric Angel - tab index code * Scott - hiding/showing selects for IE users * Todd Huss - inserting modal dynamically and anchor classes * * Up to date code can be found at http://www.subimage.com/dhtml/subModal * * * This code is free for you to use anywhere, just keep this comment block. */ // Popup code var gPopupMask = null; var gPopupContainer = null; var gPopFrame = null; var gReturnFunc; var gPopupIsShown = false; var gDefaultPage = "/loading.html"; var gHideSelects = false; var gReturnVal = null; var gTabIndexes = new Array(); // Pre-defined list of tags we want to disable/enable tabbing into var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME"); // If using Mozilla or Firefox, use Tab-key trap. if (!document.all) { document.onkeypress = keyDownHandler; } /** * Initializes popup code on load. */ function initPopUp() { // Add the HTML to the body theBody = document.getElementsByTagName('BODY')[0]; popmask = document.createElement('div'); popmask.id = 'popupMask'; popcont = document.createElement('div'); popcont.id = 'popupContainer'; popcont.innerHTML = '' + '<div id="popupInner">' + '<div id="popupTitleBar">' + '<div id="popupTitle"></div>' + '<div id="popupControls">' + '<img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" />' + '</div>' + '</div>' + '<iframe src="'+ gDefaultPage +'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>' + '</div>'; theBody.appendChild(popmask); theBody.appendChild(popcont); gPopupMask = document.getElementById("popupMask"); gPopupContainer = document.getElementById("popupContainer"); gPopFrame = document.getElementById("popupFrame"); // check to see if this is IE version 6 or lower. hide select boxes if so // maybe they'll fix this in version 7? var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) { gHideSelects = true; } // Add onclick handlers to 'a' elements of class submodal or submodal-width-height var elms = document.getElementsByTagName('a'); for (i = 0; i < elms.length; i++) { if (elms[i].className.indexOf("submodal") == 0) { // var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};'; // elms[i].onclick = eval(onclick); elms[i].onclick = function(){ // default width and height var width = 400; var height = 200; // Parse out optional width and height from className params = this.className.split('-'); if (params.length == 3) { width = parseInt(params[1]); height = parseInt(params[2]); } showPopWin(this.href,width,height,null); return false; } } } } addEvent(window, "load", initPopUp); /** * @argument width - int in pixels * @argument height - int in pixels * @argument url - url to display * @argument returnFunc - function to call when returning true from the window. * @argument showCloseBox - show the close box - default true */ function showPopWin(url, width, height, returnFunc, showCloseBox) { // show or hide the window close widget if (showCloseBox == null || showCloseBox == true) { document.getElementById("popCloseBox").style.display = "block"; } else { document.getElementById("popCloseBox").style.display = "none"; } gPopupIsShown = true; disableTabIndexes(); gPopupMask.style.display = "block"; gPopupContainer.style.display = "block"; // calculate where to place the window on screen centerPopWin(width, height); var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); gPopupContainer.style.width = width + "px"; gPopupContainer.style.height = (height+titleBarHeight) + "px"; setMaskSize(); // need to set the width of the iframe to the title bar width because of the dropshadow // some oddness was occuring and causing the frame to poke outside the border in IE6 gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px"; gPopFrame.style.height = (height) + "px"; // set the url gPopFrame.src = url; gReturnFunc = returnFunc; // for IE if (gHideSelects == true) { hideSelectBoxes(); } window.setTimeout("setPopTitle();", 600); } // var gi = 0; function centerPopWin(width, height) { if (gPopupIsShown == true) { if (width == null || isNaN(width)) { width = gPopupContainer.offsetWidth; } if (height == null) { height = gPopupContainer.offsetHeight; } //var theBody = document.documentElement; var theBody = document.getElementsByTagName("BODY")[0]; //theBody.style.overflow = "hidden"; var scTop = parseInt(getScrollTop(),10); var scLeft = parseInt(theBody.scrollLeft,10); setMaskSize(); //window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++; var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); var fullHeight = getViewportHeight(); var fullWidth = getViewportWidth(); gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px"; gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px"; //alert(fullWidth + " " + width + " " + gPopupContainer.style.left); } } addEvent(window, "resize", centerPopWin); addEvent(window, "scroll", centerPopWin); window.onscroll = centerPopWin; /** * Sets the size of the popup mask. * */ function setMaskSize() { var theBody = document.getElementsByTagName("BODY")[0]; var fullHeight = getViewportHeight(); var fullWidth = getViewportWidth(); // Determine what's bigger, scrollHeight or fullHeight / width if (fullHeight > theBody.scrollHeight) { popHeight = fullHeight; } else { popHeight = theBody.scrollHeight; } if (fullWidth > theBody.scrollWidth) { popWidth = fullWidth; } else { popWidth = theBody.scrollWidth; } gPopupMask.style.height = popHeight + "px"; gPopupMask.style.width = popWidth + "px"; } /** * @argument callReturnFunc - bool - determines if we call the return function specified * @argument returnVal - anything - return value */ function hidePopWin(callReturnFunc) { gPopupIsShown = false; var theBody = document.getElementsByTagName("BODY")[0]; theBody.style.overflow = ""; restoreTabIndexes(); if (gPopupMask == null) { return; } gPopupMask.style.display = "none"; gPopupContainer.style.display = "none"; if (callReturnFunc == true && gReturnFunc != null) { // Set the return code to run in a timeout. // Was having issues using with an Ajax.Request(); gReturnVal = window.frames["popupFrame"].returnVal; window.setTimeout('gReturnFunc(gReturnVal);', 1); } gPopFrame.src = gDefaultPage; // display all select boxes if (gHideSelects == true) { displaySelectBoxes(); } } /** * Sets the popup title based on the title of the html document it contains. * Uses a timeout to keep checking until the title is valid. */ function setPopTitle() { return; if (window.frames["popupFrame"].document.title == null) { window.setTimeout("setPopTitle();", 10); } else { document.getElementById("popupTitle").innerHTML = window.frames["popupFrame"].document.title; } } // Tab key trap. iff popup is shown and key was [TAB], suppress it. // @argument e - event - keyboard event that caused this function to be called. function keyDownHandler(e) { if (gPopupIsShown && e.keyCode == 9) return false; } // For IE. Go through predefined tags and disable tabbing into them. function disableTabIndexes() { if (document.all) { var i = 0; for (var j = 0; j < gTabbableTags.length; j++) { var tagElements = document.getElementsByTagName(gTabbableTags[j]); for (var k = 0; k < tagElements.length; k++) { gTabIndexes[i] = tagElements[k].tabIndex; tagElements[k].tabIndex="-1"; i++; } } } } // For IE. Restore tab-indexes. function restoreTabIndexes() { if (document.all) { var i = 0; for (var j = 0; j < gTabbableTags.length; j++) { var tagElements = document.getElementsByTagName(gTabbableTags[j]); for (var k = 0; k < tagElements.length; k++) { tagElements[k].tabIndex = gTabIndexes[i]; tagElements[k].tabEnabled = true; i++; } } } } /** * Hides all drop down form select boxes on the screen so they do not appear above the mask layer. * IE has a problem with wanted select form tags to always be the topmost z-index or layer * * Thanks for the code Scott! */ function hideSelectBoxes() { for(var i = 0; i < document.forms.length; i++) { for(var e = 0; e < document.forms[i].length; e++){ if(document.forms[i].elements[e].tagName == "SELECT") { document.forms[i].elements[e].style.visibility="hidden"; } } } } /** * Makes all drop down form select boxes on the screen visible so they do not reappear after the dialog is closed. * IE has a problem with wanted select form tags to always be the topmost z-index or layer */ function displaySelectBoxes() { for(var i = 0; i < document.forms.length; i++) { for(var e = 0; e < document.forms[i].length; e++){ if(document.forms[i].elements[e].tagName == "SELECT") { document.forms[i].elements[e].style.visibility="visible"; } } } } Obrigado!
  9. Voltando... Olá reabrir o tópico para tirar uma dúvida, o exemplo que você me mostrou ele funciona com onclick, mas quando passo para onload ele da erro... Não abre, por que? Para deixar mais claro, foi esse exemplo que usei: http://sublog.subimage.com/articles/2006/01/01/subModal Obrigado!
  10. marvi

    Acesso remoto

    Olá, Gostaria de saber se tem como fazer um acesso a área de trabalho do windows de forma remota, ASP, via web / navegador? Tem um computador que o pessoal faz acesso remoto via windows mesmo... mas tem como fazer acesso remotor para um computador via web? Obrigado! Marcelo
  11. marvi

    acessar um arquivo exe

    Pessoal, queria saber como resolver isso? Como faço um site hospedado na Internet ter acesso ao um arquivo.exe em um servidor local? Esse servidor local tem que ser web com http? Ou um DNS funciona? Pois esse servidor é acessado remotamento usando o programa do windows "conexão da área de trabalho remota" e assim tenho acesso ao arquivo.exe, mas quero esse acesso pelo link do site... O ASP faz acesso remoto? Na verdade é um acesso remoto da área de trabalho de um computador via web/navegador... Pode? Há um arquivo .exe em um servidor local do cliente... Criei um site hospedado em outro servidor na web, tipo locaweb, que terá um link para que o usuário clique e execute esse arquivo.exe, mas não quero que salve e sim que abra ele direto no navegador para a pessoa colocar o seu usuário e senha e logar o sistema remotamente. Como faço? Tentei: <script TYPE="text/javascript"> function Executar(Servidor, Caminho, DirTrabalho) { var param = "/inc/TerminalService/rodar.asp?Servidor="+Servidor+"&Caminho="+escape(Caminho)+"&DirTrabalho="+escape(DirTrabalho); // alert(Caminho); window.open(param,'_blank',''); }</script> <a HREF="java script:Executar('SERVIDOR', 'C:/Terminal/arquivo.exe','');">Teste</a> Mas não entendi mais esse código, ele usa rodar.asp? Esse arquivo, rodar.asp, deve ta lá no servidor com o programa arquivo.exe ou não? Preciso de DNS... E se não tiver? Já que ele não é um servidor web... Obrigado!!!!
  12. marvi

    Access 2007 no Access XP

    há tudo bem então, estou providenciando o oficce 2007... é o jeito... mas qualquer coisa eu instalo o oficce 2003 e pego pack de compatibilidade só que para a versão 2003 abrir arquivos do 2007... Sabe especificamente onde tem esse pack? Obrigado!
  13. marvi

    Access 2007 no Access XP

    já baixei o runtime e nada... já baixei duas vezes e instalei e reneciei e nada!
  14. Olá pessoal, eu já vi uma vez que quando a gente acessa um site abre um popup que não é bloqueado pelo anti-popup e que quando o popup / janela estiver aberto, a pessoa não tem acesso ao site por trás... O popup além de ficar na frente do site, ele bloqueia e ninguém acessar o site por trás, a não ser que feche o popup antes. Alguém sabe como é isso? Como faz? Obrigado! Marcelo
  15. Olá pessoal, Tenho instalado um Access XP, mas me passaram um arquivo do Access 2007, tem como abrir um arquivo Access 2007 no Access XP? Algum arquivo para baixar? Instalei um tal de AccessRuntime, mas não deu em nada. Obrigado!
  16. marvi

    ASP

    Thiago, Eu fiz uns campos e deixei logo com focus pelo javascript, que aí o leitor vai ler e já vai preencher no campo do form que tiver em foco, isso? Mas se for vários campos, automaticamente ele vai caindo para outros camps e preenchendo, como se fosse um TAB do telcado? E ao final do preenchemento como dou um submeter, envio o formulário para o banco de dados automaticamente para que a pessoa não precise precionar o enter ou clicar no botão enviar toda hora? Obrigado!
  17. marvi

    ASP

    Pessoal, É possível desenvolver um sistema em ASP, que será rodado na maquina local mesmo, localhost, para entrada e saída de material, vendas... Mas interagindo com a pistola, o leitor óptico, para que a pessoa não precise digitar? Tipo como em sistemas com outra linguagem? Se sim, como é o procedimento ou onde acho material que ensine isso? Será um sistema rodando no navegador, até aí tudo bem, ele preenche tudo normal, cadastra... mas no caso ele iria se ligar com uma pistola que irá ler os produtos para não ter em preencher as coisas. É possível isso com o ASP ou só pode com linguagem Delphi, C++ e etc? O banco de dados será possível só com o Access. Preciso muito, Obrigado! Marcelo
  18. Mudar? Se quiser te mando o arquivo para ver... É assim, a index tem: <script src="funcoes.js" type="text/javascript"></script> <select name="paises" id="paises" onchange="RetornoAjax(this.value, 'estados.asp', 'estados')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%= tab("id_pais")%>"><%= tab("pais")%></option> <% tab.movenext wend %> </select> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Estados:</font></td> </tr> <tr> <td width="100%"><div name="estados" id="estados"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Cidades:</font></td> </tr> <tr> <td width="100%"><div name="cidades" id="cidades"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Zona (Cidade de São Paulo):</font></td> </tr> <tr> <td width="100%"><div name="zona" id="zona"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Profissionais:</font></td> </tr> <tr> <td width="100%"><div name="profs" id="profs"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> onde seleciona o combo país e assim chama a função original (que atende outros combos): função.js: function RetornoAjax(id, url, container) { if (id == "") { var txt = "1" document.getElementById("estados").innerHTML = "<select></select>"; document.getElementById("cidades").innerHTML = "<select></select>"; document.getElementById("zona").innerHTML = "<select></select>"; document.getElementById("profs").innerHTML = "<select></select>"; return } var xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Este browser não suporta HTTP Request") return } var url=url; url=url+"?id="+id;url=url+"?"+txt; // nesse txt que fica o nome e não o value do selec, era para ser... // ele funciona normal no split... a coisa é colocar o valor do nome aí e não outro value igual... url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById(container).innerHTML=xmlHttp.responseText; } } xmlHttp.open("GET",url,true) xmlHttp.send(null) } function GetXmlHttpObject() { var objXMLHttp=null if (window.XMLHttpRequest) objXMLHttp=new XMLHttpRequest() else if (window.ActiveXObject) objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") return objXMLHttp } que chama (pela função acima) a página estado.asp. Isso depois que solecionou o combo país: estado.asp: id = split(Request.QueryString("id"),"?") info = id(0) info1 = id(1) sql = "select * from estados where id_pais ="& info &" order by estado desc" set tab = conexao.execute(sql) %> <select name="estados" id="estados" onchange="RetornoAjax(this.value, 'cidades.asp', 'cidades')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%=tab("id_estado")%>"><%=tab("estado")%></option> <% tab.movenext wend conexao.close set tab = nothing %> </select> que por sua vez chama o combo cidade: id = split(Request.QueryString("id"),"?") info = id(0) info1 = id(1) sql = "select * from cidades where id_estado ="& id &" and ok <> "& idi &" order by cidade desc" set tab = conexao.execute(sql) if not tab.eof then cidadet=tab("ok") if cidadet = "True" then %> <select name="cidades" id="cidades" onchange="RetornoAjax(this.value, 'zonas.asp', 'zona')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%= tab("id_cidade")%>"><%= tab("cidade")%></option> <% tab.movenext wend conexao.close set tab = nothing %> </select> <%else%> <select name="cidades" id="cidades" onchange="RetornoAjax(this.value, this.text, 'profissionais.asp', 'profs')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%= tab("id_cidade")%>"><%= tab("cidade")%></option> <% tab.movenext wend conexao.close set tab = nothing %> </select> <%end if end if %>
  19. mas todos estão assim, que depois é retornado para o que te mostrei que só tem as divs, entendeu? Tem a seguinte função que faz o trabalho por trás certo, esta função recebe o valor, a pagina que irá processar e o objeto que receberá o conteúdo, certo? Seu usuário foi e escolheu um estado, o script faz a pesquisa e traz os estados correto? Ai o usuário escolhe um estado e você quer que traga as cidades certo? É assim, veja esse site: http://www.sbpi.org.br/profissionaislink.asp la tem uns combos para pesquisar país, estado, cidade e profissão... é nesse modelo Só que no meu, quando for sair a cidade são paulo eu irei mostrar outro combo exibindo: zona leste, sul, norte e etc... Mas quando for outras cidades, ele pula esse combo e exibi o próximo, já que não tem necessidade de zonas...
  20. Sei sobre o que você falou, mas os outros tem nome sim... Veja que no script ele chama uma página e retorna para a original... Se quero estado ele vai nessa página e devolve para div, acho: id = split(Request.QueryString("id"),"?") info = id(0) info1 = id(1) sql = "select * from estados where id_pais ="& info &" order by estado desc" set tab = conexao.execute(sql) %> <select name="estados" id="estados" onchange="RetornoAjax(this.value, 'cidades.asp', 'cidades')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%=tab("id_estado")%>"><%=tab("estado")%></option> <% tab.movenext wend conexao.close set tab = nothing %> </select> Aí devolve para outra que postei, não há uma identificação?
  21. Pessoal, coloquei esse comando var indice = document.form1.cidades.selectedIndex var txt=document.form1.cidades.options[indice].text e pegou o valor do pais, no select, mas não quero o valor do selecte paises, quero o valor do select estado e / ou cidades, como faço? Pois coloquei esse codigo acima na função e dava: é nulo ou não é um objeto, pois só funciona se eu colocar o select pais: document.form1.paises.selectedIndex E agora? <form method="POST" action="resultado.asp" name="form1"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1"> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Países:</font></td> </tr> <tr> <td width="100%"> <select name="paises" id="paises" onchange="RetornoAjax(this.value, 'estados.asp', 'estados')" style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"> <option value="">-Selecione-</option> <% while not tab.eof %> <option value="<%= tab("id_pais")%>"><%= tab("pais")%></option> <% tab.movenext wend %> </select></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Estados:</font></td> </tr> <tr> <td width="100%"><div name="estados" id="estados"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Cidades:</font></td> </tr> <tr> <td width="100%"><div name="cidades" id="cidades"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Zona (Cidade de São Paulo):</font></td> </tr> <tr> <td width="100%"><div name="zona" id="zona"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"><font color="#3A5278" face="Arial Narrow" size="2">Profissionais:</font></td> </tr> <tr> <td width="100%"><div name="profs" id="profs"><select style="font-family: Verdana; font-size: 10 px; color: #808080; border: 1px solid #808080"></select></div></td> </tr> <tr> <td width="100%"> <input type="submit" value="Buscar" name="B1" style="color: #FFFFFF; font-size: 10 px; font-family: Verdana; border: 1px solid #808080; background-color: #3A5278"></td> </tr> </table> </form> </td> </tr> </table>
  22. Pessoal estou usando a seguinte função onchange="RetornoAjax(this.value, this.text, 'estados.asp', 'estados')" Vejam o This.text Função function RetornoAjax(id, txt, url, container) { if (id == "") { document.getElementById("estados").innerHTML = "<select></select>"; document.getElementById("cidades").innerHTML = "<select></select>"; document.getElementById("zona").innerHTML = "<select></select>"; document.getElementById("profs").innerHTML = "<select></select>"; return } var xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Este browser não suporta HTTP Request") return } var url=url; url=url+"?id="+id;url=url+"?"+txt; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById(container).innerHTML=xmlHttp.responseText; } } xmlHttp.open("GET",url,true) xmlHttp.send(null) } function GetXmlHttpObject() { var objXMLHttp=null if (window.XMLHttpRequest) objXMLHttp=new XMLHttpRequest() else if (window.ActiveXObject) objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") return objXMLHttp } Mas o meu this.txt está levando um valor undefined, por que? Desde já agradeço Marcelo
  23. Conseguir mais uma etapa mas surgiu outro erro: Mas a questão é que pego o value do select, sabem agora como pegar o nome do select para eu fazer duas comparações na query? Sabe qual comando no script que pega isso? Resposta: onchange="RetornoAjax(this.value, 'estados.asp', 'estados')" troca para onchange="RetornoAjax(this.value, [b]this.text[/b], 'estados.asp', 'estados')" E no JS troque: function RetornoAjax(id, url, container) { Por: Só que essa variavel txt só gera um valor: undefined, por que?
  24. Pode deixar, resolvir assim: url=url+"?id="+id;url=url+"?"+id; id = split(Request.QueryString("id"),"?") info = id(0) info1 = id(1) Mas a questão é que pego o value do select, sabem agora como pegar o nome do select para eu fazer duas comparações na query? Sabe qual comando no script que pega isso? obrigado!
×
×
  • Criar Novo...