Foros del Web » Programando para Internet » Jquery »

Mask no funciona dentro de tabber

Estas en el tema de Mask no funciona dentro de tabber en el foro de Jquery en Foros del Web. index.php Código: <link rel="stylesheet" href="../css/example.css" TYPE="text/css" MEDIA="screen"> <link rel="stylesheet" href="../example-print.css" TYPE="text/css" MEDIA="print"> <link rel="stylesheet" type="text/css" href="../css/select_dependientes.css"> <script src="../js/select_dependientes.js"></script> <script src="../js/jquery-1.7.2.min.js"></script> <script src="../js/jquery.maskedinput.js"></script> <script> jQuery(function($){ $("#telf1").mask("999-9999"); ...
  #1 (permalink)  
Antiguo 10/09/2014, 13:32
 
Fecha de Ingreso: junio-2012
Mensajes: 44
Antigüedad: 11 años, 10 meses
Puntos: 0
Mask no funciona dentro de tabber

index.php
Código:
<link rel="stylesheet" href="../css/example.css" TYPE="text/css" MEDIA="screen">
<link rel="stylesheet" href="../example-print.css" TYPE="text/css" MEDIA="print">
<link rel="stylesheet" type="text/css" href="../css/select_dependientes.css">
<script src="../js/select_dependientes.js"></script>
<script src="../js/jquery-1.7.2.min.js"></script>
<script src="../js/jquery.maskedinput.js"></script>
<script>
jQuery(function($){
$("#telf1").mask("999-9999");
$("#telf2").mask("999-999999");
}); 
</script>
<SCRIPT>
function IsNumeric(valor) 
{ 
var log=valor.length; var sw="S"; 
for (x=0; x<log; x++) 
{ v1=valor.substr(x,1); 
v2 = parseInt(v1); 
//Compruebo si es un valor numérico 
if (isNaN(v2)) { sw= "N";} 
} 
if (sw=="S") {return true;} else {return false; } 
} 
var primerslap=false; 
var segundoslap=false; 
function formateafecha(fecha) 
{ 
var long = fecha.length; 
var dia; 
var mes; 
var ano; 
if ((long>=2) && (primerslap==false)) { dia=fecha.substr(0,2); 
if ((IsNumeric(dia)==true) && (dia<=31) && (dia!="00")) { fecha=fecha.substr(0,2)+"/"+fecha.substr(3,7); primerslap=true; } 
else { fecha=""; primerslap=false;} 
} 
else 
{ dia=fecha.substr(0,1); 
if (IsNumeric(dia)==false) 
{fecha="";} 
if ((long<=2) && (primerslap=true)) {fecha=fecha.substr(0,1); primerslap=false; } 
} 
if ((long>=5) && (segundoslap==false)) 
{ mes=fecha.substr(3,2); 
if ((IsNumeric(mes)==true) &&(mes<=12) && (mes!="00")) { fecha=fecha.substr(0,5)+"/"+fecha.substr(6,4); segundoslap=true; } 
else { fecha=fecha.substr(0,3);; segundoslap=false;} 
} 
else { if ((long<=5) && (segundoslap=true)) { fecha=fecha.substr(0,4); segundoslap=false; } } 
if (long>=7) 
{ ano=fecha.substr(6,4); 
if (IsNumeric(ano)==false) { fecha=fecha.substr(0,6); } 
else { if (long==10){ if ((ano==0) || (ano<1900) || (ano>2100)) { fecha=fecha.substr(0,6); } } } 
} 
if (long>=10) 
{ 
fecha=fecha.substr(0,10); 
dia=fecha.substr(0,2); 
mes=fecha.substr(3,2); 
ano=fecha.substr(6,4); 
// Año no viciesto y es febrero y el dia es mayor a 28 
if ( (ano%4 != 0) && (mes ==02) && (dia > 28) ) { fecha=fecha.substr(0,2)+"/"; } 
} 
return (fecha); 
}
</SCRIPT>
<!--
Load prototype.js
You can get it at http://prototype.conio.net/
-->
<script src="http://www.barelyfitz.com/projects/tabber/effects/prototype.js" type="text/javascript"></script>

<script type="text/javascript">

document.write('<style type="text/css">.tabber{display:none;}<\/style>');

var tabberOptions = {

'onClick': function(argsObj) {

var t = argsObj.tabber; /* Tabber object */
var i = argsObj.index; /* Which tab was clicked (0..n) */
var div = this.tabs[i].div; /* The tab content div */

/* Display a loading message */
div.innerHTML = "<p>Cargando...<\/p>";

/* Fetch some html depending on which tab was clicked */
var url = 'DatosGenerales-' + i + '.php';
var pars = 'foo=bar&foo2=bar2'; /* just for example */
var myAjax = new Ajax.Updater(div, url, {method:'get',parameters:pars});
},

'onLoad': function(argsObj) {
/* Load the first tab */
argsObj.index = 0;
this.onClick(argsObj);
},
}
</script>

<script type="text/javascript" src="../js/tabber.js"></script>

<style type="text/css">
.tabberlive .tabbertab {
height:650px;
}
</style>
</head>
<body>

<h1>Ingreso Nuevo Personal</h1>

<div class="tabber">

<div class="tabbertab">
<h2>Datos Personales</h2>
</div>

<div class="tabbertab">
<h2>Datos Familiares</h2>
</div>

<div class="tabbertab">
<h2>Grado de Estudios</h2>
</div>

<div class="tabbertab">
<h2>Titulos Prof.</h2>
</div>

<div class="tabbertab">
<h2>Capacitaciones</h2>
</div>

<div class="tabbertab">
<h2>Carrera Adm. PJ</h2>
</div>

<div class="tabbertab">
<h2>Méritos</h2>
</div>

<div class="tabbertab">
<h2>Deméritos</h2>
</div>

<div class="tabbertab">
<h2>Licencias</h2>
</div>

<div class="tabbertab">
<h2>Vacaciones</h2>
</div>

<div class="tabbertab">
<h2>Medidas Disc.</h2>
</div>

<div class="tabbertab">
<h2>Evaluaciones</h2>
</div>
</div>
</body>
</html>
DatosGenerales-0.php
Código:
<?php session_start(); 
include '../cn.php';
?>
<head>
<script src="../js/jquery-1.7.2.min.js"></script>
<script src="../js/jquery.maskedinput.js"></script>
<script>
jQuery(function($){
$("#telf1").mask("999-9999");
$("#telf2").mask("999-999999");
}); 
</script>
</head>
<?php
function generadepartamentos()
{
include ('../cn.php');
$result=odbc_exec($conn,"select * from tabdpto");
echo "<select name='dpto' id='dpto' onChange='cargaContenido(this.id)'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
}
?>
<body>
<table width="900" border="1" align="center">
<tr>
<th align="left" scope="row">Dist. Jud. Nomb. / F. Ing.</th>
<td colspan="2">
<?php
$result=odbc_exec($conn,"SELECT * FROM tabdist order by codigo asc");
echo "<select name='corte' id='corte'>";
echo "<option>".'Seleccione'."</option>"; 
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descr1']."</option>";	
}
echo "</select>";
?>
</td>
<td>
<input type="text" name="fecing" id="fecing" size="10" maxlength="10" onKeyUp="this.value=formateafecha(this.value);"/>
</td>
</tr>
<tr>
<th align="left" scope="row">Escalafon / Plaza / Progr.</th>
<td><input type="text" name="esca" id="esca" style="width:50px" /></td>
<td><input type="text" name="plaza" id="plaza" style="width:50px" /></td>
<td>
<?php
$result=odbc_exec($conn,"select * from tabprog where codigo='A' or codigo='F' or codigo='C' or codigo='P' or codigo='M' or codigo='U' or
codigo='R' or codigo='I' or codigo='2' or codigo='D' or codigo='E' or codigo='T' or codigo='N' or codigo='J' or 
codigo='3' or codigo='1' or codigo='4' or codigo='5' or codigo='7' or codigo='L' or codigo='O' or codigo='S'");
echo "<select name='prog' id='prog'>";
echo "<option>".'Seleccione'."</option>"; 
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
</tr>
<tr>
<th align="left" scope="row">Apellidos y Nombres</th>
<td colspan="3"><input type="text" name="nomape" id="nomape" style="width:318px" /></td>
</tr>
<tr>
<th align="left" scope="row">Nacionalidad / F. Nac. </th>
<td><input type="text" name="nac" id="nac" style="width:70px" /></td>
<td><input type="text" name="fecna" id="fecna" size="10" maxlength="10" onKeyUp="this.value=formateafecha(this.value);"/>
</td>
<td></td>
</tr>
<tr>
<th align="left" scope="row">Dpto. / Provincia de Nac.</th>
<td colspan="2">
<div id="demoIzq">
<?php
generadepartamentos();
?>
</div>
</td>
<td>
<div id="demoDer">
<select disabled="disabled" name="prov" id="prov">
<option value="0">Selecciona opci&oacute;n...</option>
</select>
</div>
</td>
</tr>
<tr>
<th align="left" scope="row">Sexo / Estado Civ. / Gpo Sang.</th>
<td>
<?php
$result=odbc_exec($conn,"select * from tabsexo'");
echo "<select name='sexo' id='sexo'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
<td>
<?php
$result=odbc_exec($conn,"select * from tabestc order by codigo asc");
echo "<select name='est' id='est'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
<td>
<?php
$result=odbc_exec($conn,"SELECT * FROM tabgpos");
echo "<select name='gsan' id='gsan'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
</tr>
<tr>
<th align="left" scope="row">Reg. Pensiones / Autog. A.F.P.</th>
<td colspan="2">
<?php
$result=odbc_exec($conn,"select * from tabregp where Codigo in (0,3,4,5,6,7,8,9,10,11)");
echo "<select name='regpen' id='regpen'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
<td><input type="text" name="afp" id="afp" /></td>
</tr>
<tr>
<th align="left" scope="row">Nivel Instruct. / Titulo Prof.</th>
<td colspan="2">
<?php
$result=odbc_exec($conn,"select * from tabnins");
echo "<select name='ninst' id='ninst'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
<td>
<?php
$result=odbc_exec($conn,"select * from tabtit0");
echo "<select name='tpro' id='tpro'>";
while ($row = odbc_fetch_array($result)){ 
echo "<option value='$row[codigo]'>".$row['descri']."</option>";	
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td><input type="text" name="telf1" id="telf1" /></td>
<td><input type="text" name="telf2" id="telf2" style="width:70px" /></td>
</tr>
</table>
en la Pagina index.php hay un tabber, cada pestaña del tabber llama a una pagina diferente, en una de esas pagina que es "datos generales.."
he creado una mascara
para un campo de numero de telefono pero no me funciona, pero si yo ejecuto la pagina que llamo en el tabber aparte sin estar dentro tabber si funciona. y no se porque parece que un codigo bloquea al otro o algo asi.
  #2 (permalink)  
Antiguo 12/09/2014, 10:12
 
Fecha de Ingreso: junio-2012
Mensajes: 44
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: Mask no funciona dentro de tabber

ayuda....!!

Etiquetas: ajax, funcion, html, input, javascript, js, php, select, valor
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 16:41.