I have a 5 panel multi step form that uses divs 'previous'
and 'next'
to navigate through. I would like to make it so hitting a left arrow key acts as clicking the previous button, but hitting the right arrow key will act as hitting right.
I have this working.. Sort of.
I have bind(ed) my arrow keys correctly, but since it's going off of class name, it wants to tab through every single one of them. Is there a way to do it so it only activates the one that is on the <fieldset>
currently displaying?
<input type="button" name="previous" class="previous action-button" value="Previous" />
//binds left/right for navigation
$(window).bind('keydown', function(e){
if (e.keyCode==37) {
$(".previous").trigger("click");
} else if (e.keyCode==39) {
$(".next").trigger("click");
};
});