PREGUNTAS POR CONTESTAR - JavaScript

 Hay un total de 45 Preguntas.<<  >> 

    Pregunta:  68123 - MULTIPLES MENUS DE SALTO CON UN BOTON DE SUBMIT
Autor:  Fernando LIc
HOLA, QUERIA VER SI ALGUIEN PUEDRA SABER ALGO AL RESPECTO.
HE ENCONTRADO UN CODIGO QUE HA PERMITIDO TENER SOLO 2 MENUS DE SALTO CON UN BOTON SUBMIT, SIN EMBARGO A LA HORA QUE QUIERO INCREMENTAR OTRO MENU DE SALTO, ME MARCA ERRORES DE SINTAXIS Y POR MAS QUE ENCUENTRO MI LOGICA NO VEO EL ERROR. PORFAVOR SI ALGUIEN SUPIDERA LO AGRADECERIA MUCHO. DEGO AQUI AMBOS CODIGOS EL ORIGINAL Y EL QUE HE QUERIDO EDITAR.


ORIGINAL.

<!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>


EL QUE HE QUERIDO EDITRAR

<!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>
Contestar

    Pregunta:  68196 - DISEÑA UN PLAN DE PRUEBAS !!
Autor:  Guillermo Perales
Hola me podeis ayudar con este ejercicio por favor:

EJERCICIO:

La nueva aplicación de entrada de pedidos mediante web ya está finalizada. Los desarrolladores han hecho sus pruebas específicas; sin embargo, ahora es el momento de implicar a los usuarios para que realicen sus propias pruebas. Diseña un plan de test teniendo en cuenta el ámbito de las pruebas, las restricciones y asunciones que creas convenientes y la metodología que utilizarás. Por último, genera un plan de entregas de documentación de las pruebas.

En este ejercicio hay que definir una seríe de pruebas que harias a unos usuarios que estuvierán testeando una aplicación en fase de desarrollo. Por ejemplo:

-En un documento de texto añadir una imagen.

Y por ejemplo se evaluaría cuanto tardan en hacer esa tarea, si les surje algun problema o les resulta muy dificil encontrar las herramientas indicadas en el programa.

Gracias
Contestar

    Pregunta:  68234 - GUARDAR DATOS EN TABLA DE UNA LISTA DE SELECCION MULTIPLE
Autor:  Natalia Cedeño
Tengo una duda. Tengo dos listas de seleccion multiple de las cuales de localidad1 paso ciertos valores a localidad2. Como hacerle para que esos valores que agrege a localidad2 me los agrege a la BD al darle aceptar

Con esta funcion paso los valores
//Javascript

function pass() {
obj=document.getElementById('localidad');
if (obj.selectedIndex==-1) return;
valor=obj.$ciudad;
txt=obj.options[obj.selectedIndex].text;
obj.options[obj.selectedIndex]=null;
obj2=document.getElementById('localidad1');
opc = new Option(txt,valor);
eval(obj2.options[obj2.options.length]=opc);
}


con este ciclo jalo los valores de la BD para llenar la lista1

//PHP
$norow = mysql_num_rows($result_localidad);
for($contador=0; $contador< $norow; $contador++){
$id_municipio = mysql_result($result_localidad, $contador, "id_municipio");
$id_entidad = mysql_result($result_localidad, $contador, "id_entidad");
$localidad= mysql_result($result_localidad, $contador, "localidad");?>
<option selected> <?php echo ($id_entidad.' '.$localidad); ?> </option>

Como le hago para jalar los valores q seleccione de lista2 para guardarlos en la BD?

Tengo este ciclo para insertar pero creo q antes tengo q crear una funcion para poder guardar.

for ($i=0;$i<count($norow);$i++){
echo $norow[$i];
echo "<INSERT INTO grupo_elem (id_entidad, localidad, id_municipio) VALUES $norow>";
}

Saludos =)
Contestar

    Pregunta:  68247 - VARIABLES GLOBALES EN JAVASCRIPT Y IFRAME
Autor:  Jeffrey Sanchez
Buenas tengo un problema en un archivo js, creo mis variables globales y en una primera funcion les asigno los valores que obtengo de un evento, luego a salir de esa funcion hago el llamado a otra funcion donde utilizare el valor que le di a esas variables pero me sale que las variables estan undefined

el codigo que tengo es el siguiente, si alguno tiene la solucion les agradeceria

//////////list event//////////
var codigo = "codigo";
var nombre = 'nombre';
var dpto = 'dpto';
var loc = 'loc';
var fecha = 'fecha';
var he = 'he';
var hs = 'hs';
var obs = 'obs';
$(document).ready(function(){
$("#list_events tr").dblclick(function(){
var indice = -1;
indice += $("table tr").index($(this));
codigo = $('#list_events tr').eq(indice).find("td").eq(0).text();
nombre = $('#list_events tr').eq(indice).find("td").eq(1).text();
dpto = $('#list_events tr').eq(indice).find("td").eq(2).text();
loc = $('#list_events tr').eq(indice).find("td").eq(3).text();
fecha = $('#list_events tr').eq(indice).find("td").eq(4).text();
he = $('#list_events tr').eq(indice).find("td").eq(5).text();
hs = $('#list_events tr').eq(indice).find("td").eq(6).text();
obs = $('#list_events tr').eq(indice).find("td").eq(7).text();
$.fancybox({
autoSize: false,
autoDimensions: false,
width: 737,
height: 535,
fitToView: false,
padding: 0,
title: this.title,
href: 'edit_admin_event.php',
type: 'iframe'
});
});
});

/*EDIT ADMIN EVENT*/
//////////load data//////////
function load_data(){
//Aqui me muestra los valores de las variables indefinido
document.getElementById("ie_codigo").value = window.codigo;
document.getElementById("ie_name").value = nombre;
document.getElementById("ie_date").value = fecha;
document.getElementById("ie_hini").value = he;
document.getElementById("ie_hfin").value = hs;
}
Contestar

    Pregunta:  68303 - MOSTAR CONTENIDOS IFRAME
Autor:  Armando Vargas
Hola, buen dia, tengo un problema espero me puedan apoyar, agradecira mucho.
Tengo un iframe en una <section> en mi pagina principal.html
<iframe id="iframe" name="iframe" class = "iframe" width="220" height="385" src="situvie_primer.html"></iframe>
Y tengo una segunda pagina segunda.html, donde tengo una lista de botones, a los cuales asigno una función.

En esta función quisiera que abriera una tercera pagina y la mostrara en el iframe generado en principal.html, he investigado sin exito, solo encuentro que puedo acceder a ese iframe mediant parent.

Muchas Gracias
Contestar

|<  <<  1 2 3 4 5  >>  >|