Ver Mensaje Individual
  #9 (permalink)  
Antiguo 17/04/2009, 08:10
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Recorrer solo registros existentes !!!

Fijate así (no uses input type image: submiten el formulario)
Código PHP:
<?php 
$vec
=array('uno','dos','tres','cuatro');
?>

<!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=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<script>
function t(n){return document.getElementById(n)}
var actual=0;
var vec=['<?php echo implode("','",$vec?>'];
onload=function(){
    t('code').value=vec[actual];
}
function ant(){
    actual= vec[actual-1]?actual-1:actual
    t('code').value=vec[actual];
}
function sig(){
    actual= vec[actual+1]?actual+1:actual
    t('code').value=vec[actual];
}
</script>
</head>

<body><form><table border="0" id="tablita" bordercolor="#FFCC33">
<tr align="left">
<td><a href="#" onclick="ant();return false;">&lt;&lt;</a></td>
<td><font color="red" size="1"></font>Codigo</td>
<td><input id="code" type="text" size="8" name="code" value="<?php echo $_POST['code'?>"></td>
<td><a href="#" onclick="sig();return false;">&gt;&gt;</a></td>
</tr>
</table></form>
</body>
</html>