Focal Point
Maintain AutoSkip to the next field conflicts with having a default button.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7991062682

June 02, 2008, 11:48 AM
KentO
Maintain AutoSkip to the next field conflicts with having a default button.
I now have to use JavaScript behind the Keypress event on a Maintain screen to move the cursor from one field to another when the first field is filled with data. An example of the JavaScript code follows:


function OnL1feedback_Edit_KeyPress ( ) {
if (document.Form1.Field1_Edit.value.length > 49)
{document.Form1.Field2_Edit.focus();}
else
{document.Form1.Field1_Edit.focus();}
}

The problem with this is that pressing the enter key will not activate the Default Button if the cursor is still in Field1.

Is there a way to move the cursor to the next field when the previous field is filled but still have a active Default button if enter is pressed from the first field?

Thanks, Kent


Windows2003 Server, WebFOCUS 7.7.02 Developers Studio and MRE
June 04, 2008, 10:48 AM
Maintain Wizard
In the JavaScript, could you check the value of the keypress, and if it is ENTER then PERFORM the case behind the default button?

Mark