Validating textbox dating a single father forum
Combing the 2, I do my validation at the lostfocus event of the object.I believe doing data validation at the change event is asking too much from the system." id="ctl00_m_m_i_ctl00_gr_ctl03_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3947262" / Data validation is something we always struggle with, when and how best to do it.Also you can use input data validation to force user to enter appropriate data type.For a example if there is a text field in the form to enter the users age.So, for example, you can test for an alphabetic character this way: By the way, while you can do all of this in the Change event, it's usually better to enable Key Press events and perform the testing in the Key Press event procedure. Key Ascii = number(Key Ascii) End Sub ' Function number(tecla As Integer) ???
I have code that works great for alphabet (letter) entry. Private Sub Text Box82_Change() 'Validation to ensure only Letters may be entered into the text box.
In ASP it is still a pain, but a window's form gives us better interation with our forms.
I prefer to check my datatype at the level of the database. I often validate my data at user interface only when such data will be used in a formula in the UI.
In most cases when you prompt for age as an input you can set maxlength to 2.
You can do these validation events such as onclick, mouse over, on change, etc.
However, I often like to apply both preventive and corrective measures when I validate data.