Information générale
Catégorie:
Codage, syntaxe et commandes
>Hello:
>
>I have a form that users must mandatory entries into textboxes
>before they exit the screen and move on to another screen.
>
>For example:
>
>If empty(act_plan.startdate)
>=messagebox("You must enter a Startdate for your Intervention!", 48, "CATS")
> this.parent.text1.setfocus()
>Endif
>
>I have this code in the save button and if nothing entered it sets focus to that field until something is entered. I also have this code in the exit button on the form. If they inadvertly hit the exit button I get the message, it doesn't set focus to the textbox
>and continues on and releases the form.
>
>How can I ensure that they fill this textbox and not exit the screen
>screen? Does this code belong in the "valid" of the textbox as well?
>Any input would be appreciated.
>Thanks.
>
>Sheena
Is the terminate read property of the exit button .t.? If so, turn it off and only clear events if act_plan.startdate is not empty.
I really don't advise duplicating code though and you should have a generic validate method for the field and this validation should be called when necessary.
Mace
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement