Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Wednesday, March 25, 2009

Auto Tab In PeopleSoft

We had an interesting requirement to implement Auto-tab functionality in PeopleSoft. In a grid with 3 columns, ( Say Field ABC, Field MNO, Field PQR from record XYZ each having length of 3 Character), when user will start inserting data in Field ABC, after entering 3 characters the cursor should automatically move to Field MNO and so on.

Approach:
To make generic solution, we added following piece of javascript code in delivered PT_EDITSCRIPT HTML definition:

/* Custom JavaScript Function */
function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
return "";
}

And then added an HTML area in the requested page with a constant value as below:

and it worked well !