on 04-29-2005 1:39 PM
<b><i>Hi experts</i></b>,
How do you do when you want to check a value in a inputfield with type="date" ? My problem is that the field date is obligatory. When the inputfield is post with the form, this one is not null and not empty but equal to "0000-00-00" which correspond to "Sun Nov 30 00:00:00 CET 0002" in a Date type ! So how can I verify that my date field had not been set ?
<b><i>Best regards</i></b>.
Maybe use apache commons GenericValidator or regular expressions form the java.util.regex package.
Regards
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do one thing. You can write a javascript function to check the value of the field and then submit the form. This way you can check whether it is blank or not.
Hope this helps.
Ranjith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you dont want to use javascript I always write a generic validate method (returning Boolean) called with a hashtable of fields to check. For JSP you can call this method in doProcessBeforeOutput or onSubmit (or any event that involves a round trip) if the fields don't have the correct values return a false and in your main method decide whether to proceed with processing the form or set the field to invalid and the state of the form back to edit mode for the user to correct the field value.
Regards
Daniel
User | Count |
---|---|
73 | |
11 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.