pui.gotoPreviousElement(currentElement)
This feature is available with Profound UI releases later than Version 6 Fix Pack 4.1.
This function moves the text cursor to the previous enabled visible input element from the current element.
Parameter:
currentElement -- the reference to the current DOM element.
Example:
You can use this API and the related API pui.gotoNextElement() to move the cursor forward and backward through all enabled visible input elements on a panel by using the Enter and Alt-Enter keys respectively.
Add this code to the “onload” event of a record format:
window.enterDoesTab = function(event) {
event = event || window.event;
if (event.keyCode == 13) {
if (event.ctrlKey || event.shiftKey)
return;
preventEvent(event);
if (event.altKey) // Alt-Enter key pressed
pui.gotoPreviousElement(event.srcElement);
else // Enter key pressed
pui.gotoNextElement(event.srcElement);
}
}
addEvent(pui.runtimeContainer, "keydown", enterDoesTab);
Add this code to the “onsubmit” event of the same record format:
removeEvent(pui.runtimeContainer,"keydown",enterDoesTab);