Ir para conteúdo
Fórum Script Brasil

princesa

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre princesa

  • Data de Nascimento 17/12/1982

Perfil

  • Gender
    Female
  • Location
    são paulo

princesa's Achievements

0

Reputação

  1. Olá Pessoal, Por favor eu gostaria de inserir dois jump menu na minha página um com listagem de produtos outro com categorias, quando insiro somente um este funciona, mas quando insiro os dois só um funciona, não entendo muito de javascript, mas andei pesquisando e acho q é porque estou usando a mesma função para os dois, será isso mesmo??? Alguém pode me ajudar a resolver este problema sem ter de usar um menu só....Agradeço vocês amigos! <select name='cat' id='cat' class='postform' > <option value='-1'>Pesquisa por Categoria</option> <option class="level-0" value="17">COSMÉTICOS TESTADOS</option> <option class="level-1" value="22"> corpo</option> <option class="level-1" value="23"> mãos</option> <option class="level-1" value="21"> rosto</option> <option class="level-0" value="15">Lançamentos nota 10!</option> <option class="level-0" value="7">Maquiagem testada!</option> <option class="level-1" value="20"> acessórios</option> <option class="level-1" value="4"> face</option> <option class="level-1" value="5"> lábios</option> <option class="level-1" value="19"> olhos</option> <option class="level-0" value="16">Na cabeleira!</option> <option class="level-0" value="9">Perfumes por elas!</option> <option class="level-0" value="1">Sem categoria</option> <option class="level-0" value="14">Testados por nós!</option> </select> &lt;script type='text/javascript'> /* <![CDATA[ */ var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "http://www.testadoporelas.com.br/?cat="+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; /* ]]> */ </script> <select name='marca' id='marca' class='postform' > <option value="0">Pesquisa por Marca de Cosméticos</option> <option value=41>Acqua Di Parma</option> <option value=27>Alfaparf</option> <option value=29>Amazonia Viva</option> <option value=101>Zirh</option></select> &lt;script type='text/javascript'> /* <![CDATA[ */ var dropdown = document.getElementById("marca"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "http://www.testadoporelas.com.br/?cat="+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; /* ]]> */ </script> </body> </html></div> <div class="textwidget"><html> <head> &lt;script type='text/javascript'> /* <![CDATA[ */ var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "http://www.testadoporelas.com.br/?cat="+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; /* ]]> */ </script> [/codebox]
  2. Olá Pessoal, Por favor eu tenho o seguinte código para criar um jump menu dinamico, mas gostaria que quando o item da segunda janela fosse selecionado automaticamente fosse direcionado para uma url..o q devo mudar no código? Grata <html> <head><title>Javascript Dynamic ListBox Demonstration</title> </head> <body bgcolor="#ffffff" OnLoad="setOption(document.ThisForm, 0)"> <blockquote> <form name="ThisForm"> <!-- The listbox size should be same as the list which has the maximum size. i.e. The number of "<option>" = the size of the maximum list. //--> <select name="List1" OnChange="setOption(this.form, this.selectedIndex)"> <option>Animals <option>Colours <option>Numbers <option>Places </select><p> <select name="List2" OnChange="this.form.ValueIn2.value=this.options[this.selectedIndex].value"> <option> <option> <option> <option> <option> <option> <option>_________________ </select> </form> &lt;script language="javascript"> <!-- function setOption(form, index) { for (var i = 0; i < form.List2.length; i++) { form.List2.options[i].text = ""; form.List2.options[i].value = ""; } if (index == 0) { form.List2.options[0].text = "Cat"; form.List2.options[0].value = "verdade" form.List2.options[1].text = "Lion"; form.List2.options[1].value = "ani1"; form.List2.options[2].text = "Tiger"; form.List2.options[2].value = "ani2"; form.List2.options[3].text = "Dog"; form.List2.options[3].value = "ani3"; form.List2.options[4].text = "Cow"; form.List2.options[4].value = "ani4"; form.List2.options[5].text = "Snake"; form.List2.options[5].value = "ani5"; form.List2.options[6].text = "Monkey"; form.List2.options[6].value = "ani6"; } else if (index == 1) { form.List2.options[0].text = "Blue"; form.List2.options[0].value = "col0"; form.List2.options[1].text = "Red"; form.List2.options[1].value = "col1"; form.List2.options[2].text = "Yellow"; form.List2.options[2].value = "col2"; form.List2.options[3].text = "Green"; form.List2.options[3].value = "col3"; form.List2.options[4].text = "Orange"; form.List2.options[4].value = "col4"; } else if (index == 2) { form.List2.options[0].text = "One"; form.List2.options[0].value = "num0"; form.List2.options[1].text = "Two"; form.List2.options[1].value = "num1"; form.List2.options[2].text = "Three"; form.List2.options[2].value = "num2"; form.List2.options[3].text = "Four"; form.List2.options[3].value = "num3"; form.List2.options[4].text = "Five"; form.List2.options[4].value = "num4"; } else if (index == 3) { form.List2.options[0].text = "Airport"; form.List2.options[0].value = "pla0"; form.List2.options[1].text = "Railway Station"; form.List2.options[1].value = "pla1"; form.List2.options[2].text = "Museum"; form.List2.options[2].value = "pla2"; form.List2.options[3].text = "Stadium"; form.List2.options[3].value = "pla3"; } form.List2.selectedIndex = 0; form.ValueIn2.value = form.List2.options[form.List2.selectedIndex].value; } //--> </script> </blockquote> <p> <center> </center> </body> </html> [/codebox]
×
×
  • Criar Novo...