ayeshanasreen
asked on
Best way of Handling Field Level Validations
hi all
I have many forms which requires Only Numeric, Only Alphabetic, BothAlpha Numeric and No spl. characters.
Which is the best suitable approach to validate the form fields before storing it into the database.
Is it possible to write a generalized routine for handling all the forms in common.
do suggestions needed.
thanks
I have many forms which requires Only Numeric, Only Alphabetic, BothAlpha Numeric and No spl. characters.
Which is the best suitable approach to validate the form fields before storing it into the database.
Is it possible to write a generalized routine for handling all the forms in common.
do suggestions needed.
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can roll-your-own textbox controls or use third-party controls to restrict your users' input.
My saying to my VB students:
"The best validation is the one that requires no code, because the user is limited to entering only valid data."
My saying to my VB students:
"The best validation is the one that requires no code, because the user is limited to entering only valid data."
>>What I had done to handle this is to have a user-control that added a DataType property. With this, I defined the type of valid data allowed in the field, such as numeric, integer, alpha-only, "sentence", alpha-numeric, e-mail, etc. When the field is created, define the DataType property and the validation can be done during data entry.<<
If you are interested to create a usercontrol then check out the "PART 2" this link:
http://216.26.168.92/vbworld/file.aspx?tag=activex
It will surely help you to create your own control, without having actually to make validation for each TextBox
-priya
If you are interested to create a usercontrol then check out the "PART 2" this link:
http://216.26.168.92/vbworld/file.aspx?tag=activex
It will surely help you to create your own control, without having actually to make validation for each TextBox
-priya
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.
Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.
DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
area; if you have any comment about the question, please leave it here.
Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.
DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
For specific field validation (mandatory, minimum length, ...), you better validate in the LostFocus event of each controls.
For referential validation (if FieldA is empty then FieldB must not be empty, ...), you better use form validation (in your save button click event for example).
Using appropriate controls helps you a lot (like a mask edit box, date time picker, ...).