The form has First Name, Last Name, Course and Email text box fields.
First/Last Name must have no spaces, Course must consist of a three letters and two numbers in that order and nothing else(I want to avoid the use of masked text box), and Email must have the "@" sign and a dot.
How would one make it so after clicking, say, Submit button and if there was a violation of any of the above rules then message box should pop up and tell the user which fields contain incorrect information.
Private Sub buttonAddNewStudent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonAddNewStudent.Click 'validation must be performed before the corresponding text box items will be placed inside an array arrayRecord(0) = textFirstName.Text arrayRecord(1) = textLastName.Text arrayRecord(2) = textCourse.Text arrayRecord(3) = textEmail.Text arrayAddNewStudent = Join(arrayRecord, ",") Me.DialogResult = DialogResult.OK End Sub
This post has been edited by ravencode: 01 December 2010 - 12:17 PM