You say that the form sends an empty string but your error checker doesn't detect empty strings? Have you tried debugging your code to see what *actually* the error checker is checking against?
There are a number of ways in which the problem can be rectified but without knowing the actual business context, suggesting an appropriate solution might be a bit difficult. How are you actually sending that value to the server? Setting it using Javascript? Sending it via hidden variables? Is that value mandatory i.e. should that value always be a digit?
As far as the solution is considered, there are a couple of them:
- If a check for blank string fails it means that the value sent consists of spaces. Try trimming the string before checking it for blank.
- You can always catch the NumberFormatException which is thrown when parsing the fails thereby handling all invalid input.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
Offline 8,872 posts
since Jun 2006