all the validation below will work if i have any missing field.it will prompt me.
but the thing is after it prompt me the error, i enter the correct value,but how cum the validation txt would be still be there after the correct value had been enter?
how to make it disappeared?
pls help.
thank you.
'-- CHECK FOR VALID RECORD ---
Dim ValidRecord As Boolean = True
'-- Check for missing Name
If txtName.Text = "" Then
errorname.Text = "Missing Name"
ValidRecord = False
End If
'-- Check for missing Address
If txtAddress.Text = "" Then
erroradd.Text = "Missing Address"
ValidRecord = False
End If
'-- Check for valid Postal Code
If Not IsNumeric(txtPcode.Text) Then
errorPC.Text = "Invalid Postal Code format"
ValidRecord = False
End If
'-- Check for missing Gender
If cboGender.Text = "" Then
errorGender.Text = "Missing Gender"
ValidRecord = False
End If
'-- Check for missing contactno
If txtContactNo.Text = "" Then
errorContactNo.Text = "Missing Contact No"
Else
If Not IsNumeric(txtContactNo.Text) Then
errorContactNo.Text = "Invalid Contact No format"
ValidRecord = False
End If
End If
'-- Check for missing DOB
If txtDOB.Text = "" Then
errorDOB.Text = "Missing DOB"
ValidRecord = False
End If
'-- Check for missing IC
If txtIC.Text = "" Then
errorNRIC.Text = "Missing IC"
ValidRecord = False
End If
but the thing is after it prompt me the error, i enter the correct value,but how cum the validation txt would be still be there after the correct value had been enter?
how to make it disappeared?
pls help.
thank you.
'-- CHECK FOR VALID RECORD ---
Dim ValidRecord As Boolean = True
'-- Check for missing Name
If txtName.Text = "" Then
errorname.Text = "Missing Name"
ValidRecord = False
End If
'-- Check for missing Address
If txtAddress.Text = "" Then
erroradd.Text = "Missing Address"
ValidRecord = False
End If
'-- Check for valid Postal Code
If Not IsNumeric(txtPcode.Text) Then
errorPC.Text = "Invalid Postal Code format"
ValidRecord = False
End If
'-- Check for missing Gender
If cboGender.Text = "" Then
errorGender.Text = "Missing Gender"
ValidRecord = False
End If
'-- Check for missing contactno
If txtContactNo.Text = "" Then
errorContactNo.Text = "Missing Contact No"
Else
If Not IsNumeric(txtContactNo.Text) Then
errorContactNo.Text = "Invalid Contact No format"
ValidRecord = False
End If
End If
'-- Check for missing DOB
If txtDOB.Text = "" Then
errorDOB.Text = "Missing DOB"
ValidRecord = False
End If
'-- Check for missing IC
If txtIC.Text = "" Then
errorNRIC.Text = "Missing IC"
ValidRecord = False
End If