Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validate controls or fields
Message
De
12/06/2002 11:10:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667196
Message ID:
00667408
Vues:
23
>Is there a recommended method to validating data on a form?
>
>Assuming the control is bound to a table field...
>
>Which is better?
>
>
>if empty(table.field) then
>  =messagebox('this field cannot be empty')
>  return
>endif
>
>
>or
>
>
>if empty(thisform.text1.value) then
>  =messagebox('this field cannot be empty')
>  return
>endif
Hi there :)

How about valid method on textbox itself ?
That's why is there.
if empty(this.value)
   return .f.
endif
Aldough nowdays everybody is preaching about midle tier data components,
business rules etc. ; In case of simple apps with simple data input
you can do quiet well just by using existing VFP features.

Sometime is good to keep it simple :-)
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform