Foros del Web » Programando para Internet » Javascript »

Multiples Menus de salto con un solo BOTON DE SUBMIT

Estas en el tema de Multiples Menus de salto con un solo BOTON DE SUBMIT en el foro de Javascript en Foros del Web. Hola soy nuevo en el foro, sin embargo encontre este lugar para ver si alguien me puede ayudar. La ida es crear diversos menus de ...
  #1 (permalink)  
Antiguo 12/08/2013, 18:36
 
Fecha de Ingreso: agosto-2013
Ubicación: Puebla
Mensajes: 6
Antigüedad: 10 años, 8 meses
Puntos: 0
Exclamación Multiples Menus de salto con un solo BOTON DE SUBMIT

Hola soy nuevo en el foro, sin embargo encontre este lugar para ver si alguien me puede ayudar.

La ida es crear diversos menus de salto que con un solo boton de submit me pueda llevar al enlace correcto.

El problema que encuentro es que el boton submit obedece unicamente al un solo select, por lo que mi imagino que se requiere de un codigo php y javascript para crear este nuevo submit


gracias y buen dia


LES DEJO ALGO DEL COGIDO PARA VER QUE OPINAN
Código HTML:
<!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=utf-8" />
<title>Documento sin título</title>
</head>

<body>

<script type="text/javascript">


function MM_resolveTargetUrl(firstObjId,secondObjId,tercer,targ,restore){

var firstSelObj = null;
var secondSelObj = null;
var tercer = null;


with (document){

if (getElementById) {

firstSelObj = getElementById(firstObjId);
secondSelObj = getElementById(secondObjId);
tercer = getElementById(tercerId);
}// end if

// WARNING: The following logic will only work if the initial values of the dropdown boxes are ---TEST1--- and ---TEST2---
// Change the if condition if the initial values are something else!!
if (firstSelObj.value == "---TEST1---"){ // user has not selected from first dropdown
if (secondSelObj.value == "---TEST2---") { // user has not selected from the second dropdown
if (tercer.value == "---TEST3---") { // user has not selected from the second dropdown


alert("Please select an option from the dropdown menus!");
return
}// end nested if

else { // user has selected from the second dropdown

eval(targ+".location='"+secondSelObj.options[secondSelObj.selectedIndex].value+"'");
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
if (restore) tercer.selectedIndex=0;
return;
}// end nested else
}// end if
else { // user has selected from the first dropdown

eval(targ+".location='"+firstSelObj.options[firstSelObj.selectedIndex].value+"'");
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
if (restore) tercer.selectedIndex=0;
return;
}// end else
}// end with
}// end MM_resolveTargetUrl

eval(targ+".location='"+tercer.options[tercer.selectedIndex].value+"'");
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
if (restore) tercer.selectedIndex=0;
return;
}// end else
}// end with
}// end MM_resolveTargetUrl



</script>
</head>

<body>
<form name="form" id="form" accept-charset="" >

<!-- WARNING: There is logic in the MM_resolveTargetUrl function above that relies on the initial values of the dropdown boxes.
If the initial values ---TEST1--- and ---TEST2--- change, the if conditions in the function must be changed as well!! -->
<select name="jumpMenu" id="jumpMenu" style="background-color:#fff; width:150px; color:#666;">
<option selected = "TEST1" class="red" style="font-size: 0.9em; font-family: Arial; text-indent:0.3em; ">---TEST1---</option>
<option value="http://www.google.com" style="font-size: 0.9em; font-family: Arial;">GOOGLE</option>
</select>


<!-- WARNING: There is logic in the MM_resolveTargetUrl function above that relies on the initial values of the dropdown boxes.
If the initial values ---TEST1--- and ---TEST2--- change, the if conditions in the function must be changed as well!! -->
<select name="jumpMenu2" id="jumpMenu2" style="background-color:#000; width:150px; color:#CCC;">
<option selected = "TEST2" style="font-size: 0.9em; font-family: Arial;">---TEST2---</option>
<option value="http://www.yahoo.com" style="font-size: 0.9em; font-family: Arial;">YAHOO</option>
</select> 

<select name="jumpMenu3" id="jumpMenu3" style="background-color:#000; width:150px; color:#CCC;">
<option selected = "TEST3" style="font-size: 0.9em; font-family: Arial;">---TEST2---</option>
<option value="http://www.yahoo.com" style="font-size: 0.9em; font-family: Arial;">YAHOO</option>
</select> 


<input type="button" name="go_button" id= "go_button" value="Go" onClick="MM_resolveTargetUrl('jumpMenu','jumpMenu2','jumpMenu3','parent',1)" >

</legend>
</form>
</body>
</html> 


ESTE ES EL CODIGO QUE YO ESTABA EDITANDO, PERO AQUI LES DEJO EL ORIGINAL...



Código HTML:
<!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=utf-8" />
<title>Documento sin título</title>
</head>

<body>

<script type="text/javascript">


function MM_resolveTargetUrl(firstObjId,secondObjId,targ,restore){

var firstSelObj = null;
var secondSelObj = null;


with (document){

if (getElementById) {

firstSelObj = getElementById(firstObjId);
secondSelObj = getElementById(secondObjId);
}// end if

// WARNING: The following logic will only work if the initial values of the dropdown boxes are ---TEST1--- and ---TEST2---
// Change the if condition if the initial values are something else!!
if (firstSelObj.value == "---TEST1---"){ // user has not selected from first dropdown
if (secondSelObj.value == "---TEST2---") { // user has not selected from the second dropdown

alert("Please select an option from the dropdown menus!");
return
}// end nested if

else { // user has selected from the second dropdown

eval(targ+".location='"+secondSelObj.options[secondSelObj.selectedIndex].value+"'");
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
return;
}// end nested else
}// end if
else { // user has selected from the first dropdown

eval(targ+".location='"+firstSelObj.options[firstSelObj.selectedIndex].value+"'");
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
return;
}// end else
}// end with
}// end MM_resolveTargetUrl

</script>
</head>

<body>
<form name="form" id="form" accept-charset="" >

<!-- WARNING: There is logic in the MM_resolveTargetUrl function above that relies on the initial values of the dropdown boxes.
If the initial values ---TEST1--- and ---TEST2--- change, the if conditions in the function must be changed as well!! -->
<select name="jumpMenu" id="jumpMenu" style="background-color:#fff; width:150px; color:#666;">
<option selected = "TEST1" class="red" style="font-size: 0.9em; font-family: Arial; text-indent:0.3em; ">---TEST1---</option>
<option value="http://www.google.com" style="font-size: 0.9em; font-family: Arial;">GOOGLE</option>
</select>


<!-- WARNING: There is logic in the MM_resolveTargetUrl function above that relies on the initial values of the dropdown boxes.
If the initial values ---TEST1--- and ---TEST2--- change, the if conditions in the function must be changed as well!! -->
<select name="jumpMenu2" id="jumpMenu2" style="background-color:#000; width:150px; color:#CCC;">
<option selected = "TEST2" style="font-size: 0.9em; font-family: Arial;">---TEST2---</option>
<option value="http://www.yahoo.com" style="font-size: 0.9em; font-family: Arial;">YAHOO</option>
</select> 


<input type="button" name="go_button" id= "go_button" value="Go" onClick="MM_resolveTargetUrl('jumpMenu','jumpMenu2','parent',1)" >

</legend>
</form>
</body>
</html> 

SI SE DAN CUENTA EN EL ORIGINAL SI SE PUEDE, PERO EN EL QUE YO EDITO PARA AGREGAR MAS MENUS DE SALTO, ME TRABE DE TAL FORMA QUE YA ACABE CON JAQUECA........UN SALUDO Y OJALA PUEDAN AYUDARME
  #2 (permalink)  
Antiguo 30/08/2013, 18:33
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Respuesta: Multiples Menus de salto con un solo BOTON DE SUBMIT

Hola:

No deberías revivir temas sin aportar cosas nuevas... (habrás notado que está borrado el último mensaje).

Sobre la pregunta, no tiene respuesta por alguna razón... por ejemplo, yo no me he enterado, y tampoco he visto el botón del tipo submit (encontré uno con type="button").

También he notado que usas funciones empezadas por MM_, evidenciando que son de MacroMedia; posiblemente código generado por viejas versiones de dreamweaver, tal vez sea mejor que empieces desde cero; por ejemplo intentando explicar mejor tu problema.

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #3 (permalink)  
Antiguo 30/08/2013, 18:46
 
Fecha de Ingreso: agosto-2013
Ubicación: Puebla
Mensajes: 6
Antigüedad: 10 años, 8 meses
Puntos: 0
Respuesta: Multiples Menus de salto con un solo BOTON DE SUBMIT

MUCHAS GRACIAS POR TU RESPUESTA, SI EN EFECTO, SOY NUEVO EN EL FORO, Y COMIENZO A ADENTRARME POR AQUI. PERO CON TODO EL GUSTO DEL PLANETA DE LO QUE YO SEPA AYUDARE EN MIS POSIBILIDADES.

EN EFECTO, NO ES UN SUBMIT, ((ME EQUIVOQUE)) ES UN BOTON QUE LLEVA AL OBJETO SELECCIONADO POR EL USUARIO.

EL PROBLEMA COMIENZA DESDE QUE INTENTE INCREMENTAR EL NUMERO DE <select> y options QUE RESPONDAN CON EL MISMO BUTTOM.

PERO ESE ES EL PROBLEMA ...NO PUEDO.

Y DE VERDAD AGRADEZCO SU TIEMPO....
  #4 (permalink)  
Antiguo 30/08/2013, 18:51
 
Fecha de Ingreso: agosto-2013
Ubicación: Puebla
Mensajes: 6
Antigüedad: 10 años, 8 meses
Puntos: 0
Respuesta: Multiples Menus de salto con un solo BOTON DE SUBMIT

En el momento que yo intento incrementar la tercera variable me marca error.
Código HTML:
<script type="text/javascript">


function MM_resolveTargetUrl(firstObjId,secondObjId,tercer,targ,restore){

var firstSelObj = null;
var secondSelObj = null;
var tercer = null;


with (document){

if (getElementById) {

firstSelObj = getElementById(firstObjId);
secondSelObj = getElementById(secondObjId);
[B]tercer = getElementById(tercerId);[/B]
}// end if

// WARNING: The following logic will only work if the initial values of the dropdown boxes are ---TEST1--- and ---TEST2---
// Change the if condition if the initial values are something else!!
if (firstSelObj.value == "---TEST1---"){ // user has not selected from first dropdown
if (secondSelObj.value == "---TEST2---") { // user has not selected from the second dropdown
[B]if (tercer.value == "---TEST3---") { // user has not selected from the second dropdown[/B]
ME GUSTARICA CONOCER UN POCO MAS AL RESPECTO DE JAVASCRIPT

MUCHISIMAS GRACIAS
  #5 (permalink)  
Antiguo 30/08/2013, 18:58
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Respuesta: Multiples Menus de salto con un solo BOTON DE SUBMIT

Hola:

Fíjate que el parámetro de la función es tercer, e intentas obtener algo que llamas tercerID.

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #6 (permalink)  
Antiguo 30/08/2013, 21:16
 
Fecha de Ingreso: agosto-2013
Ubicación: Puebla
Mensajes: 6
Antigüedad: 10 años, 8 meses
Puntos: 0
Respuesta: Multiples Menus de salto con un solo BOTON DE SUBMIT

PERFECTO, SI YA ENTENDI, YA OBTUVE MI TERCER, y Y YA ME PUDO FUNCIONAR BIEN..

MUCHAS GRACIAS Y DEJO EL CODIGO POR SI ALGUIEN MAS LO NECESITA.

Código HTML:
<!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=utf-8" />
<title>Documento sin título</title>

</head>

<body>

<script type="text/javascript">


function MM_resolveTargetUrl(firstObjId,secondObjId,tercerObjId,targ,restore){

var firstSelObj = null;
var secondSelObj = null;
var tercerSelObj = null;


with (document){

if (getElementById) {

firstSelObj = getElementById(firstObjId);
secondSelObj = getElementById(secondObjId);
tercerSelObj = getElementById(tercerObjId);
}// end if

// WARNING: The following logic will only work if the initial values of the dropdown boxes are ---TEST1--- and ---TEST2---
// Change the if condition if the initial values are something else!!
if (firstSelObj.value == "---TEST1---"){ // user has not selected from first dropdown
if (secondSelObj.value == "---TEST2---") { // user has not selected from the second dropdown
if (tercerSelObj.value == "---TEST3---") { // user has not selected from the second dropdown

alert("Please select an option from the dropdown menus!");
return
}// end nested if

else { // user has selected from the second dropdown

eval(targ+".location='"+tercerSelObj.options[tercerSelObj.selectedIndex].value+"'");
if (restore) tercerSelObj.selectedIndex=0;
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
return;
}// end else
}// end with
else { // user has selected from the first dropdown

eval(targ+".location='"+secondSelObj.options[secondSelObj.selectedIndex].value+"'");
if (restore) tercerSelObj.selectedIndex=0;
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
return;
}// end nested else
}// end if
else { // user has selected from the first dropdown

eval(targ+".location='"+firstSelObj.options[firstSelObj.selectedIndex].value+"'");
if (restore) tercerSelObj.selectedIndex=0;
if (restore) firstSelObj.selectedIndex=0;
if (restore) secondSelObj.selectedIndex=0;
return;
}// end else
}// end with
}



</script>
</head>

<body>
<form name="form" id="form" accept-charset="" >


<select name="jumpMenu" id="jumpMenu" style="background-color:#fff; width:150px; color:#666;">
<option selected = "TEST1" class="red" style="font-size: 0.9em; font-family: Arial; text-indent:0.3em; ">---TEST1---</option>
<option value="http://www.google.com" style="font-size: 0.9em; font-family: Arial;">GOOGLE</option>
</select>



<select name="jumpMenu2" id="jumpMenu2" style="background-color:#000; width:150px; color:#CCC;">
<option selected = "TEST2" style="font-size: 0.9em; font-family: Arial;">---TEST2---</option>
<option value="http://www.yahoo.com" style="font-size: 0.9em; font-family: Arial;">YAHOO</option>
</select> 


<select name="jumpMenu3" id="jumpMenu3" onchange="MM_jumpMenu('parent',this,0)"style="background-color:#fff; width:150px; color:#666;" >
  <option selected = "TEST3">---TEST3----</option>
    <option  value="http://www.bing.com">BING</option>
</select>


<input type="button" name="go_button" id= "go_button" value="Go" onClick="MM_resolveTargetUrl('jumpMenu','jumpMenu2','jumpMenu3','parent',1)" >
</legend>
</form>
</body>
</html> 

Etiquetas: dreamweaver8, html5, javascript+html, menus, php+ajax+formularios, salto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:17.