2009/3/9 RobG <[email protected]>
>
>
>
> On Mar 10, 10:20 am, "Miguel Beltran R." <[email protected]> wrote:
> > Hi list
> >
> > How can do it when I press automatic change to next field visible? the
> field
> > can be input=text or input=select.
>
> Use the tab key, it navitates through visible form controls by default
> - no script required.
>
>
Thanks Rob, but I want when press <enter> key (ascii 13) have the same
behavior what tab key
Now I made this
function avanza_campo(evt){
var el=evt.element();
while(1){
var el2=el.next('input, select, button, submit');
console.log("cambiando de el='%s' a el2='%s'", el.id, el2.id);
if(el2.type=='hidden'){
el=el2;
}else{
return true;
}
if(el==evt.element())return false;
}
}
But not work how I expect,
Starting in input id="material" el2 is fondo -> cuenta -> undefined, no
return input with id="vale"
<li><label for="material"><a id="material_window"
href="#">Material</a></label>
<input type="text" id="material" name="material" size="5" />
<span id="material_porgastar"></span>
<span id="material_nombre"></span>
<input type="hidden" id="fondo" name="fondo" />
<input type="hidden" id="cuenta" name="cuenta" />
</li>
<li><label for="vale">Vale</label>
<input type="text" id="vale" name="vale" size="5">
</li>
>
> --
> Rob
> >
>
--
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---