08-21-2008 12:30 PM
Hello,
I created several EditField for gethering address like addr, city, state and zipcode.
I want to give some alert without moving next field if user dodn't fill out the field.
Is there anyway for this feature?
Thanks,
DK.
Solved! Go to Solution.
08-21-2008 01:36 PM
Try this:
EditField ef = new EditField("Text: ","<data>"); String s = ef.getText(); if (s.equals("")){ //if the EditField does not contain data }else{ //it does contain data }
Check for that at: onClose()
08-21-2008 01:43 PM
I suggest you override onUnfocus() to do this.
Unfortunately this doesn't stop anyone "submitting" immediately without going through your protected fields, so I have never bothered with this. It is also incredibly annoying if you really want to fill out the screen in a different order than they are displayed. Instead, I do the 'not empty' checking as part of the submit process. But that is just me......