Log in

View Full Version : Problem in function of enter key



rhodarose
02-22-2011, 07:07 AM
Good day!

I got problem in my function on enter key.. I attached my files and code for better understanding of my problem..

Thank you in advance

Schmoopy
02-22-2011, 07:18 AM
If it's a problem with that sort of thing, you want the JavaScript section.

rhodarose
02-23-2011, 02:35 AM
I think so....


Thank you...

traq
02-23-2011, 03:51 AM
you might want to add an introduction/summary of your problem. People are more likely to look into helping with your problem if they have a decent idea of what your problem is.

rhodarose
02-23-2011, 05:24 AM
Here is the summary of my problem...

I used function on enter key for moving on the next texbox and it works from the plt date textbox up to lot/batch # but when I press enter key instead of the cursor goes to time in textbox ti goes to save button. Save button should be hit after shift textbox.


Thank you

fastsol1
02-23-2011, 12:54 PM
Wouldn't using "tab order" be a better idea for this

traq
02-23-2011, 08:25 PM
that's what I was thinking. but, in any case, in your code I can track your order up to #bom0 - i.e., there's a handleEnter call that looks for #bom0, but I don't see any element with that name in the markup. Are you trying to get to the first #bom? I'm not sure how you'd define that in the script. You'd probably have to add an "array index" argument to the function, but you'll have to get some javascript help for that.

However, as fastol mentions, you could skip the mess altogether by using the tabindex attribute. it would require using [tab] instead of [enter] to navigate (perfectly acceptable, IMHO), or, you could try something like this:

function EnterToTab(e)
{
if(e.keyCode === 13)
{
e.keyCode=9; return e.keyCode;
}
}

(Completely untested, I haven't looked into this at all. just a possible solution: when the user presses [enter], return the [tab] keycode instead.)



Actually, it looks like there's quite a bit more to it (http://scripterlative.com/files/entertotab.htm) than that