Hi,
I have a small problem. I have a form that is taking in a credit card number. The
servlet that the form is posted to is to check the credit card number for two things:
1. to make sure it's at least 15 digits for american express and maximum 16 for visa and mastercard.
2. make sure the field was not left blank.
I have the first task done. But I'm unsure how to ensure the field isn't left blank.
My servlet reads in the value from the form as follows:
long cardnumber = Long.parseLong(request.getParameter("ccnumber"));
How can I check if the field is left blank, which gives the result "".
P.s. I know I could use javascript on the
jsp page to ensure a value is entered before the form can be submitted, but I'd rather not if possible.