In this app I'm creating, I've written a Sub to validate user input on a EditText.
The problem is even if the conditions in the NormalInputVerify Sub are met or not, after executing the Sub, it returns to the End of the btnSearch_Click Sub.
Can anyone tell me how to correct this?
Thank you
B4X:
Sub btnSearch_Click
Dim selection, search_string As String
selection = spnrSearchBy.SelectedItem.Trim
search_string = txtSearch.Text.Trim
If selection = "Area" OR selection = "Service Name" OR selection = "Hotline" Then
NormalInputVerify
Else If selection = "Cost" Then
CostInputVerify
End If
End Sub 'End of the btnSearch_Click Sub
Sub NormalInputVerify As Boolean
If txtSearch.Text.Trim.Length = 0 Then
ToastMessageShow("Please enter a search string", False)
Return False
Else If txtSearch.Text.Trim.Length < 3 Then
ToastMessageShow("Search string must be at least 3 characters long", False)
Return False
End If
End Sub
The problem is even if the conditions in the NormalInputVerify Sub are met or not, after executing the Sub, it returns to the End of the btnSearch_Click Sub.
Can anyone tell me how to correct this?
Thank you