Tema: Clonar Table
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/07/2006, 13:47
Avatar de Nano_
Nano_
 
Fecha de Ingreso: febrero-2006
Ubicación: Bogotá, Colombia
Mensajes: 1.866
Antigüedad: 18 años, 2 meses
Puntos: 96
Exclamación

Codigo Javascript
datos.js

Código HTML:
		var resul = 0;
 		var valores = new Array(0);
		var vrcife = new Array(0);
		var con = 0;
		var ind = 0;
		var valorind = 0;
		var valor = 0;
		var num=0;
		var l=1;
		var k=0;
		var q=0;
		var m=1;
		var n=0;
		var o=1;
		var p=0;
		var variable=0;
		var y=0;
		var numerr= 0;
		var w_valida = 0;
		var w_modil= 0;
    var coorX;
		var coorY;


		function valida_vacio(campo1,campo2)
        {
	    	if (campo1.value == "" || campo1.value == " " )
		   	{alert ('DEBE CAPTURAR UN VALOR VALIDO EN '+campo2);
		    campo1.focus()
		   	}
        }


		function valida_vacio1(campo1,campo2)
        {
		var alphaChars="abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
      	for(var i=0; i<campo1.value.length; i++)
         {
          for(var j=0; j<alphaChars.length; j++)
          {
           if(alphaChars.charAt(j)==campo1.value.charAt(i))
 	      {
           break;
          }
         else
          {
          if(j==(alphaChars.length-1))
           {
            alert (campo1.value.charAt(i) + '\tNO ES UN CARACTER VALIDO'+campo2 );
		    campo1.focus()
           }
          }
         }
        }
	 	}

		function valida_vacio2(campo1,campo2)
    	{

	    	if (isNaN(campo1.value))
		   	{alert ('DEBE CAPTURAR UN VALOR VALIDO EN '+campo2);
		    campo1.focus()
		   	}

    	}


		function mostrar_mensaje()
	    {
			alert ('mensaje');
		}


	function pre_mostrar_detsec5()
	{
		var msgconfirm = "AL ADICIONAR NUEVA FILA, LA ACTUAL NO SE PODRA MODIFICAR."+"\n\n"
		msgconfirm +=    "		¿Desea Continuar?"
   if ( confirm(msgconfirm) )
		{
			if ((l-1)==0)
	      {
	        validate_filasec50();
	    		if ( numerr < 1)
			   {
                       deshabilitar_filasec50()	;
                       mostrar_detsec5();
         }
			  }
		}
   }


    // Deshabilita¿Revisaste los logs del servidor?¿Revisaste los logs del servidor?¿Revisaste los logs del servidor?¿Revisaste los logs del servidor?¿Revisaste los logs del servidor?¿Revisaste los logs del servidor?¿Revisaste los logs del servidor? los campos de la forma
    function  deshabilitar_filasec50()
	{
		document.getElementById('cantidade0').disabled=true;
	}

		function mostrar_detsec5()
		{
		var objTablae = document.getElementById("seccion5");
   	var objTbodye=objTablae.firstChild;
		var objNuevaFilae=objTbodye.childNodes[0].cloneNode(true);

		objTbodye.appendChild(objNuevaFilae);
		k = l + 2;
		document.getElementById('secuencia0'+2).value=k;
    l++;
		}


   //Funcion que valida los datos dentro de la Partida Arancelaria

   function validate_filasec50()
   {
   	var Validar = new clsValidator();
    numerr = 0;
   	Validar.setEncabezado("** LA LINEA ACTUAL DE LA SECCION 5 TIENE LOS SIGUIENTES ERRORES  **");
   	Validar.setErrorColor("#FFFFCC");

		Validar.Vacio("marca0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");
 		Validar.Vacio("descrip0", "Debe llenar 7. numero y clñase de bultos; descripcion de la mercancia");
	  Validar.Vacio("cantidade0", "Debe llenar  El peso de las mercancias");
	  Validar.Vacio("criterio0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");
    Validar.Vacio("pesoneto0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");
    Validar.Vacio("gross0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");
    Validar.Vacio("Fecha0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");
    Validar.Vacio("valorfca0", "Debe llenar 6. La(s) Marca(s) y el Numero de Paquete(s).");

    if (Validar.Validar()) alert("Fila Actual de la Seccion 5, Diligenciada Correctamente");
		else Validar.getErrors();
    }


// funciones seccion 13
		function calcula_tot13()
		{
			var res131=document.forma10.turnos.value;
			var res132=document.forma10.capturno.value;

			resul= parseInt(res131) * parseInt(res132);
			document.getElementById('tot131').value=resul;
		}



// FUNCIONES GENERALES
	function manita(cual)
	{
		cual.style.cursor='hand';
	}

	function flecha(algo)
	{
		//document.forma10a.algo.style.cursor='default';
		algo.style.cursor='default';
	}

	function valida_select(campo1,campo2)
    {
	    if (campo1.value == "")
		   {alert ('DEBE SELECCIONAR UN ITEM DE '+campo2);
		    campo1.focus()
		   }
    }

 	function NumberFormat(num, numDec, decSep, thousandSep)
		{
      		var arg;
		    var Dec;
		    Dec = Math.pow(10, numDec);
		    if (typeof(num) == 'undefined') return;
		    if (typeof(decSep) == 'undefined') decSep = ',';
		    if (typeof(thousandSep) == 'undefined') thousandSep = '.';
		    if (thousandSep == '.')
		     arg=/./g;
		    else
		     if (thousandSep == ',') arg=/,/g;
		    if (typeof(arg) != 'undefined') num = num.toString().replace(arg,'');
		    num = num.toString().replace(/,/g, '.');
		    if (isNaN(num)) num = "0";
		    sign = (num == (num = Math.abs(num)));
		    num = Math.floor(num * Dec + 0.50000000001);
		    cents = num % Dec; 		    num = Math.floor(num/Dec).toString();

			var dmax = Dec.toString();
			dmax = dmax.length;
			var dmin = cents.toString();
			dmin = dmin.length;

			var ndec = (dmax - dmin) - 1;

		    if (cents < (Dec / 10))
				var nceros = '';
				if (ndec > 0)
					{for (var i = 1; i <= ndec; i++)
						nceros += "0";
			        cents = nceros + cents;
					}

//			alert('cadena de ceros a unir '+nceros+' '+'Ultima '+cents);
		    for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
		     num = num.substring(0, num.length - (4 * i + 3)) + thousandSep + num.substring(num.length - (4 * i + 3));
		    if (Dec == 1)
		     return (((sign)? '': '-') + num);
		    else
		     return (((sign)? '': '-') + num + decSep + cents);
		}

	 function EvaluateText(cadena, obj)
		{
		    opc = false;
		    if (cadena == "%d")
		     if (event.keyCode > 47 && event.keyCode < 58)
		      opc = true;
		    if (cadena == "%f")
			{
		     if (event.keyCode > 47 && event.keyCode < 58)
		      opc = true;
		     if (obj.value.search("[.*]") == -1 && obj.value.length != 0)
		      if (event.keyCode == 46)
		       opc = true;
		    }
		    if(opc == false)
		     event.returnValue = false;
		}

	function maximaLongitud(texto,maxlong)
	    {
		var tecla, in_value, out_value;
        if (texto.value.length > maxlong)
		{
		    in_value = texto.value;
		    out_value = in_value.substring(0,maxlong);
		    texto.value = out_value;
		    return false;
  		}
		  return true;
		}
__________________
:.:Nano.:: @nano_hard - Retornando al foro