Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

on enter move to next field 1

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
Hello,

I have a form that has two numeric fields, when the form loads the fields appear with a 0
I was able to get rid of this.

I was trying to add to my script that when the enter key is pressed the cursor clears the 0 and goes to the next field but looks like something is a miss and have been spinning my wheels for a while, any kind of help is much welcomed.

here is what I have

Code:
var ctrlTotal = Runner.getControl(pageid, 'QTY');
var ctrlSUM = Runner.getControl(pageid, 'SQTY');

function init() {
    // Clear forms here
ctrlTotal.setValue("");
    
}
window.onload = init;

$(document).keydown(function(e) {
  if (e.keyCode == 13) 
  {
      

function init() {
    // Clear forms here
ctrlSUM.setValue("");
    
}
window.onload = init;
  }
});
 
Why two init() functions?

one is defined and nested in .keydown() but will never be called from there by being attached to window.onload.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
ChrisHirst,

I saw where my mistake was. I appreciate you spending the time to look at it else I would never have noticed it.

again thanks,

EV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top