Date validation in a form / Javascriupt generation at the client side

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Date validation in a form / Javascriupt generation at the client side

Charles Moulliard
I would like to know How I can validate the string date inputted by a
user in a textfield of my form ?

e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy

So I would like to check that the user has well introduced its date
using this format in the html field. Is it possible to this validation
inside the Wicket Form ? Does Wicket generates javascript to validate
this at the client side like it is possible in JSP (Struts) ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Date validation in a form / Javascriupt generation at the client side

Pedro Santos
I would like to know How I can validate the string date inputted by a user
in a textfield of my form ?
you can use:
org.apache.wicket.datetime.markup.html.form.DateTextField
ex:
DateTextField date = DateTextField.forDatePattern("date", "dd/MM/yyyy");

This component will validate the inputs against the date pattern.
To output validations mensage, you can use an feedback panel

http://www.jroller.com/wireframe/entry/wicket_client_side_validation

On Fri, Sep 25, 2009 at 6:44 AM, Charles Moulliard <[hidden email]>wrote:

> I would like to know How I can validate the string date inputted by a
> user in a textfield of my form ?
>
> e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/yyyy
>
> So I would like to check that the user has well introduced its date
> using this format in the html field. Is it possible to this validation
> inside the Wicket Form ? Does Wicket generates javascript to validate
> this at the client side like it is possible in JSP (Struts) ?
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Pedro Henrique Oliveira dos Santos