Try
if(!textBox.getText().matches("[A-Za-z]+")) // fails validation, can't be
blank

if(!textBox.getText().matches("[A-Za-z]*")) // fails validation, can be
blank

You can amend the regular expression to validate pretty much anything


Ian

http://examples.roughian.com


2009/5/27 hezjing <[email protected]>

> Hi poonam
> Instead of writing your own validation class, would you consider one of the
> GWT validation libraries?
> e.g. https://sourceforge.net/projects/gwt-vl/
>
> I'm a newbie, and I'm still looking for a GWT validation library ... is
> there anyone able to share their experience in GWT validation?
>
>
> On Wed, May 20, 2009 at 8:43 PM, poonam <[email protected]> wrote:
>
>>
>> Can anyone help me in writing a simple gwt class for validating the
>> input.
>> My requirement is that, I need to check that the input in the textbox
>> is alphabetic, and if the input is anything other than alphabet it
>> displays the error message.
>> Thanks
>>
>>
>
>
> --
>
> Hez
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to