Ver Mensaje Individual
  #12 (permalink)  
Antiguo 26/01/2012, 18:05
Avatar de madhatterdef
madhatterdef
 
Fecha de Ingreso: diciembre-2011
Ubicación: argentina
Mensajes: 213
Antigüedad: 12 años, 4 meses
Puntos: 59
Respuesta: Problemas para el boton de envio

perdón no me di cuenta si funciona es (no estoy del todo seguro) por favor sube el resultado hay para verlo


js

Código:
// producto 1

var ref = new Array (                      
new Array ( 30000000 , 30289999 , "1" ),
new Array ( 40000000 , 40999999 , "1" ),
new Array ( 44760000 , 46999999 , "1" ),


// producto  2

new Array ( 41000000 , 42999999 , "2" ),
new Array ( 47000000 , 47729999 , "2" ),
new Array ( 50100000 , 50199999 , "2" ),


// producto 3

new Array ( 43000000 , 44759999 , "3" ),
new Array ( 50200000 , 50299999 , "3" ),
new Array ( 59150000 , 59179999 , "3" )
);


function ValidarOperador (numero){
    for (p in ref){
        if (numero >= ref[p][0] && numero <= ref[p][1])
            return ref[p][2];
    }  
    return "";
}

function foper(qnum){
    if (qnum.length > 3) {
        switch (qnum.length) {
            case 4:
                qnum = qnum *10000;
                operador = ValidarOperador(qnum);
                return operador;
                break;
            case 5:
                qnum = qnum *1000;
                operador = ValidarOperador(qnum);
                return operador;
                break;
            case 6:
                qnum = qnum *100;
                operador = ValidarOperador(qnum);
                return operador;
                break;
            case 7:
                qnum = qnum *10;
                operador = ValidarOperador(qnum);
                return operador;
                break;
            case 8:
                qnum = qnum *1;
                operador = ValidarOperador(qnum);
                return operador;
                break;
        }
    }
}

var c=0;
var speed=200;
var bl=0;

function blink(cell){
    if(c%2==0) {
        cell.style.backgroundColor='#33FF33';
    }
    else {
        cell.style.backgroundColor='#FFFF00';
        
    }
    c++;
    cello=cell;
    bl=setTimeout('blink(cello)',speed);
}


function refop() {
    qnum = document.refip.Submit.value
    opera = foper(qnum);    
    clearTimeout(bl);
    cell = document.getElementById('uno')
    cell.style.backgroundColor='#FFFFFF';
    cell = document.getElementById('tres')
    cell.style.backgroundColor='#FFFFFF';
    cell = document.getElementById('dos')
    cell.style.backgroundColor='#FFFFFF';
    switch (opera) {
            case '1':
                blink(document.getElementById('uno'));
                break;
            case '3':
                blink(document.getElementById('tres'));
                break;        
            case '2':
                blink(document.getElementById('dos'));
                break;
            default: 
                break;
    }
    return "";

}

function upuno(){
    var winpops=window.open("index1.html","","width=100,height=100,resizable");    
    if(!winpops)
                alert('Tu bloqueador de popups ha bloqueado la ventana, desactivalopor favor!');

}
function updos(){
    var winpops=window.open("index2.html","","width=100,height=100,resizable");
    if(!winpops)
                alert('Tu bloqueador de popups ha bloqueado la ventana, desactivalo por favor!');
}

function uptres(){
    var winpops=window.open("index3.html","","width=100,height=100,resizable");
    if(!winpops)
                alert('Tu bloqueador de popups ha bloqueado la ventana, desactivalo por favor!');
}

function refop2(e) {

tecla = (document.all) ? e.keyCode : e.which;

qnum = document.Submit.value

opera = foper(qnum);

clearTimeout(bl);

switch (opera) {
case '1' && tecla==13 : window.open('index1.html','','width=200,height=200');
break;
case '2' && tecla==13 : window.open('index2.html','','width=200,height=200');
break;
case '3' && tecla==13 : window.open('index3.html','','width=200,height=200');
break;
default:
break;
}
return "";
}
html


Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>prueba</title>
</head>


<body>
<tr>
<td><table width="738" height="80" border="0">
    
    <tr>
      <script language="JavaScript" type="text/javascript" src="ref.js?v=2.4"></script>

    </tr>
    <tr>
      <td width="209" height="71"></td>
      <td width="519"><table width="519" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="595"><table width="100%" height="69" border="0">
                <form name="refip" id="refip" onSubmit="return setpage();">
<tr>
<td align="left" style="height: 22px; width: 33%"><div align="center">
<input name="Submit" type="text" class="gt" style="font-size: 20px; color: rgb(0, 102, 204); background-color: rgb(244, 244, 244); font-family: Arial;" onKeyUp="refop(),refop2()" value="# producto" size="12" maxlength="8" onClick="this.value=''">

<br>
</span></font></div></td>
<td width="79%"><table width="109%" height="63" style="width: 100%">
<tr>
<td width="16%" id="uno"><div align="center"><a onClick="upuno()" class="gt"><img alt="texto1" src="top1.png" width="50" height="50"></a><a onClick="claropop()" class="gt"></a></div></td>
<td width="17%" id="dos"><div align="center"><a onClick="updos()" class="gt"><img alt="texto2" src="top2.png" width="50" height="50"></a></div></td>
<td width="17%" id="tres"><div align="center"><a onClick="uptres()" class="gt"><img alt="texto3" src="top3.png" width="50" height="50"></a><a onClick="movipop()" class="hand"></a></div></td>
</tr>
                        </tr>
                        <tr>
                  </td>
                  </tr>

                </form>
            </table></td>
          </tr>
          <tr>
            <td colspan="2" align="center">  
          </table></td>
    </tr>
  </table>
  
  <p><strong>Numeros para ingresar y probar el <em># de producto</em> </strong></p>

  <p>30000000 (Opcion 1) </p>
  <p>44444444 (Opcion 3)</p>
    <p>47000000 (Opcion 2)</p>
    <p>desde que se ingresan los primeros cuatro numeros identifica ya el rango como veran lo hace cambiando de colores la celda y el usuario debe dar clic en la imagen para que habra la ventana popop del producto</p>
    <p><strong>***hasta aqui todo creo va muy bien*** .</strong></p>
    <p><strong>Aqui inicia mi problema </strong></p>

    <p>Busco que al dar enter en el formulario pudiera abrir la ventana popup del producto indicado tomando el rango que se encuentra en el <strong>ref.js</strong>. ya que al dar Enter solo se reinicia el formulario y no tengo ni la minima nocion que hacer.</p>

<!-- Inserted by miarroba -->
<script type="text/javascript" src="http://hosting.miarroba.info/?d=hosting&amp;h=juegaenlinea.webcindario.com&amp;t=1327595010&amp;k=985cddc8f6976b4b722422ced6cf2aab"></script><noscript><img alt="beacon" border="0" width="1" height="1" src="http://hosting.miarroba.info/?d=hosting&amp;h=juegaenlinea.webcindario.com&amp;t=1327595010&amp;k=985cddc8f6976b4b722422ced6cf2aab&amp;img=1" /></noscript><script type="text/javascript" src="http://contadores.miarroba.es/ver.php?id=324766"></script>
<!-- Inserted by miarroba -->
</body>
</html>
disculpa la tardanza
__________________
PD gracias por el karma

Última edición por madhatterdef; 26/01/2012 a las 19:03