Ola!
alguem e me capaz de dizer se e possivel depois de refrescar os campos de uma select list no fim voltar a focar o campo que estava seleccionado??
Obrigado!
- Fórum WMO
- → Viewing Profile: Tópicos: anabattista
Community Stats
- Group Usuários
- Active Posts 10
- Profile Views 816
- Member Title Novato no fórum
- Age Age Unknown
- Birthday Birthday Unknown
-
Sexo
Não informado
Topics I've Started
Select - Focar Um Campo
07/12/2005, 12:53
Select Que Altera Um Segundo - Javascript
24/11/2005, 07:00
<script language="JavaScript" type="text/JavaScript">
function load1(){
var url;
url = 'index_mexer.php?UF='+document.Section.UF[document.Section.UF.selectedIndex].value;
document.Section.SubSec.options.length = 0;
addItem(document.Section.SubSec,"Wait...loading","",false,document.Section.SubSec.length)
myIframe.location = url;
//document.Section.SubSec[document.Section.SubSec.selectedIndex].focus()
}
//////////////i don't know why is not putting the selected option on focus after loading the 2 others select's
function start_sub(){
local1 = new Array();
var maximo1, i, campo1;
local1 = myIframe.loc;
campo1 = document.Section.SubSec;
maximo1 = local1.length;
document.Section.SubSec.options.length = 0;
addItem(campo1,'-Choose one-','',false,campo1.length);
for (i=0;i<maximo1;i++){
addItem(campo1,local1[i][1],local1[i][0],false,campo1.length);
}
}
function load2(){
var url2,url3;
url2= 'index_mexer.php?SubSec='+document.Section.SubSec[document.Section.SubSec.selectedIndex].value;
document.Section.D2.options.length = 0;
addItem(document.Section.D2,"Wait...loading","",false,document.Section.D2.length)
my2frame.location = url2;
// document.Section.D2.focus()
}
function start_key(){
local2 = new Array();
var maximo2, k, campo2;
local2 = my2frame.loc2;
campo2 = document.Section.D2;
maximo2 = local2.length;
document.Section.D2.options.length = 0;
for (k=0;k<maximo2;k++){
addItem(campo2,local2[k][1],local2[k][0],false,campo2.length);
}
}
function addItem(obj,strText,strValue,blSel,intPos){
var newOpt,i,ArTemp,selIndex;
selIndex = (blSel)?intPos:obj.selectedIndex;
newOpt = new Option(strText,strValue);
Len = obj.options.length+1
if (intPos > Len) return
obj.options.length = Len
if (intPos != Len) {
ArTemp = new Array();
for(i=intPos;i<obj.options.length-1;i++)
ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);
for(i=intPos+1;i<Len;i++)
obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);
}
obj.options[intPos] = newOpt;
if (selIndex > intPos)
obj.selectedIndex = selIndex+1;
else if (selIndex == intPos)
obj.selectedIndex = intPos;
}
</script>
Bom dia a tod@s!
tenho um problema que ja se arrasta a alguns dias... de um select onchange influencia o segundo e este por sua vez onchange influencia um terceiro. A questao e que quando faz o load no fim o campo selecionado do segundo volta sempre a "choose one" ---- addItem(campo1,'-Choose one-','',false,campo1.length);
Queria que este select mantivesse seleccionado o campo que escolhi...mas volta sempre ao "choose one" no load do 3o select. why????
function load1(){
var url;
url = 'index_mexer.php?UF='+document.Section.UF[document.Section.UF.selectedIndex].value;
document.Section.SubSec.options.length = 0;
addItem(document.Section.SubSec,"Wait...loading","",false,document.Section.SubSec.length)
myIframe.location = url;
//document.Section.SubSec[document.Section.SubSec.selectedIndex].focus()
}
//////////////i don't know why is not putting the selected option on focus after loading the 2 others select's
function start_sub(){
local1 = new Array();
var maximo1, i, campo1;
local1 = myIframe.loc;
campo1 = document.Section.SubSec;
maximo1 = local1.length;
document.Section.SubSec.options.length = 0;
addItem(campo1,'-Choose one-','',false,campo1.length);
for (i=0;i<maximo1;i++){
addItem(campo1,local1[i][1],local1[i][0],false,campo1.length);
}
}
function load2(){
var url2,url3;
url2= 'index_mexer.php?SubSec='+document.Section.SubSec[document.Section.SubSec.selectedIndex].value;
document.Section.D2.options.length = 0;
addItem(document.Section.D2,"Wait...loading","",false,document.Section.D2.length)
my2frame.location = url2;
// document.Section.D2.focus()
}
function start_key(){
local2 = new Array();
var maximo2, k, campo2;
local2 = my2frame.loc2;
campo2 = document.Section.D2;
maximo2 = local2.length;
document.Section.D2.options.length = 0;
for (k=0;k<maximo2;k++){
addItem(campo2,local2[k][1],local2[k][0],false,campo2.length);
}
}
function addItem(obj,strText,strValue,blSel,intPos){
var newOpt,i,ArTemp,selIndex;
selIndex = (blSel)?intPos:obj.selectedIndex;
newOpt = new Option(strText,strValue);
Len = obj.options.length+1
if (intPos > Len) return
obj.options.length = Len
if (intPos != Len) {
ArTemp = new Array();
for(i=intPos;i<obj.options.length-1;i++)
ArTemp[i] = Array(obj.options[i].text,obj.options[i].value);
for(i=intPos+1;i<Len;i++)
obj.options[i] = new Option(ArTemp[i-1][0],ArTemp[i-1][1]);
}
obj.options[intPos] = newOpt;
if (selIndex > intPos)
obj.selectedIndex = selIndex+1;
else if (selIndex == intPos)
obj.selectedIndex = intPos;
}
</script>
Bom dia a tod@s!
tenho um problema que ja se arrasta a alguns dias... de um select onchange influencia o segundo e este por sua vez onchange influencia um terceiro. A questao e que quando faz o load no fim o campo selecionado do segundo volta sempre a "choose one" ---- addItem(campo1,'-Choose one-','',false,campo1.length);
Queria que este select mantivesse seleccionado o campo que escolhi...mas volta sempre ao "choose one" no load do 3o select. why????

Reload De Iframe Que Nao Funciona...
14/11/2005, 10:12

a janela e javascript....
obrigado desde ja!!!
-----------princ.php----------------------
<html> <input type=button value="+" onClick="show_key('<?php echo $DD; ?>', my2frame.loc2); return false" onMouseOver="window.status='List of Keywords'; return true"> <iframe src="checkk.php" frameborder="1" width="600px" align="left" name="my3f" id="my3f" height="130px" scrolling="yes"></iframe> </html>
<script language="JavaScript"> <!-- function show_key( kSec, kList) { keyWin = window.open( "", "photo", "width=600,height=450,status,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40"); keyWin.document.write('<html><head><title>List of Keywords</title></head>'); keyWin.document.write('<body bgcolor=#CECCFF text=black link=orange vlink=red>'); keyWin.document.write('<center>'); keyWin.document.write('<form method="POST" action="checkk.php">'); ................ for (i = 0;i < Math.round(num1/3);i++) { keyWin.document.write('<STRONG><font face="Courier" size="-1">- '+kList[i][0]+'</font><STRONG><INPUT type="checkbox" name="checkk[]" value="'+kList[i][0]+ '"><br>'); } ................ keyWin.document.write('<input type="submit" align="center" value="associate with the document" onclick="window.parent.my3f.location.reload();">'); /*Ja experimentei ainda document.getElementById('my3f').reload(); */ keyWin.document.write('</form>'); keyWin.document.write('<p></font></body></html>'); keyWin.document.close(); } //--> </script>------------------checkk.php------------------
<html> <head></head> <body> Keywords: //isto aparece sempre, o resto so aparece se abrir checkk.php na propria janela popup <?php if(isset($_POST["checkk"])) { $options = $_POST['checkk']; $options_text = implode(', ',$options); echo 'Opções escolhidas: '.$options_text; } ?> </body> </html>
Janela Em Javascript
03/11/2005, 06:37
Ola galera!
Preciso de abrir uma janela em javascrip onde terei listadas multiplas keywords.
Dessa lista que vem do banco de dados terei de escolher (neste caso pode ser mais que uma ..mas nao peco tanto) uma opcao que retornara' a pagina inicial.
Se alguem tiver um script de uma janela de opcoes ...eu agradecia imenso!!!
Preciso de abrir uma janela em javascrip onde terei listadas multiplas keywords.
Dessa lista que vem do banco de dados terei de escolher (neste caso pode ser mais que uma ..mas nao peco tanto) uma opcao que retornara' a pagina inicial.
Se alguem tiver um script de uma janela de opcoes ...eu agradecia imenso!!!

Janela Em Javascript (php)
02/11/2005, 14:31
Oba ppl!
Tou a fazer umas coisas em PHP e agora preciso de abrir uma janela em javascrip onde terei listadas imensas keywords.
Dessa lista que vem da base de dados terei de escolher (neste caso pode ser mais que uma ..mas nao peco tanto) uma opcao que retornara' a pagina inicial.
Se alguem tiver um script de uma janela de opcoes ...eu agradecia imenso!!!
Thanks a lot!
Tou a fazer umas coisas em PHP e agora preciso de abrir uma janela em javascrip onde terei listadas imensas keywords.
Dessa lista que vem da base de dados terei de escolher (neste caso pode ser mais que uma ..mas nao peco tanto) uma opcao que retornara' a pagina inicial.
Se alguem tiver um script de uma janela de opcoes ...eu agradecia imenso!!!
Thanks a lot!
- Fórum WMO
- → Viewing Profile: Tópicos: anabattista
- Privacy Policy
- Regras ·