You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dennis Byrne <de...@dbyrne.net> on 2006/07/04 06:21:52 UTC

Re: required attribute of h:inputText consider space as valid value

Anthony,

Try writing a custom validator ... something like IsEmptyValidator.

Dennis Byrne

>-----Original Message-----
>From: Anthony Hong [mailto:anthony.bin.hong@gmail.com]
>Sent: Tuesday, July 4, 2006 12:09 AM
>To: 'MyFaces Discussion'
>Subject: required attribute of h:inputText consider space as valid value
>
>h:inputText can set required attribute to true, that means this field
>is a mandatory fields.
>
>But it does not trim string before validation. So an empty space also
>a valid value for input text with required attribute.
>
>How to solve this problem, that I do not have to add trim string
>function in javascript one by one. Any idea?
>
>Thanks
>-- 
>
>Anthony Hong
>



Re: required attribute of h:inputText consider space as valid value

Posted by Anthony Hong <an...@gmail.com>.
Is it possible to modify current required validation that I do not
have to change anything.

On 7/4/06, Dennis Byrne <de...@dbyrne.net> wrote:
> Anthony,
>
> Try writing a custom validator ... something like IsEmptyValidator.
>
> Dennis Byrne
>
> >-----Original Message-----
> >From: Anthony Hong [mailto:anthony.bin.hong@gmail.com]
> >Sent: Tuesday, July 4, 2006 12:09 AM
> >To: 'MyFaces Discussion'
> >Subject: required attribute of h:inputText consider space as valid value
> >
> >h:inputText can set required attribute to true, that means this field
> >is a mandatory fields.
> >
> >But it does not trim string before validation. So an empty space also
> >a valid value for input text with required attribute.
> >
> >How to solve this problem, that I do not have to add trim string
> >function in javascript one by one. Any idea?
> >
> >Thanks
> >--
> >
> >Anthony Hong
> >
>
>
>


-- 

Anthony Hong