You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Halgurt Mustafa Ali <ha...@star-trac.de> on 2006/06/26 13:04:23 UTC

Date Validation like "dd.MM.yyyy HH:mm"

Hello all,

Well I am trying to validate a field on the clients side. The field schould be validatet as a date in this format: "dd.MM.yyyy HH:mm" but I saw that the time would not be considerd, although I initialize datePattern in validation.xml with this value "dd.MM.yyyy HH:mm", the date will be validated against "dd.MM.yyyy". below is my formset in validation.xml:

<formset>    
	<form name="REPORTform">      
		<field property="datumVonLaufzeiten" depends="date">        
		<arg position="0"  key="REPORTform.datumVonLaufzeiten"/>
        <var><var-name>datePattern</var-name><var-value>dd.MM.yyyy HH:mm</var-value></var>      
		</field>      
		<field property="datumBisLaufzeiten" depends="date">        
		<arg position="0" key="REPORTform.datumBisLaufzeiten"/>
        <var><var-name>datePattern</var-name><var-value>dd.MM.yyyy HH:mm</var-value></var>      
		</field>
	</form>  
</formset>

I had a look at the validateDate.js in commons-validator.jar and I think it would not do that, what I want. Has anybody an Idea what am I doing wront, or do I have to do different.

Thank you in advance for your help,
Halgurt

Re: Date Validation like "dd.MM.yyyy HH:mm"

Posted by Niall Pemberton <ni...@gmail.com>.
Commons Validator's JavaScript only support day/month/year validation.

Niall

On 6/26/06, Halgurt Mustafa Ali <ha...@star-trac.de> wrote:
> Hello all,
>
> Well I am trying to validate a field on the clients side. The field schould be validatet as a date in this format: "dd.MM.yyyy HH:mm" but I saw that the time would not be considerd, although I initialize datePattern in validation.xml with this value "dd.MM.yyyy HH:mm", the date will be validated against "dd.MM.yyyy". below is my formset in validation.xml:
>
> <formset>
>        <form name="REPORTform">
>                <field property="datumVonLaufzeiten" depends="date">
>                <arg position="0"  key="REPORTform.datumVonLaufzeiten"/>
>        <var><var-name>datePattern</var-name><var-value>dd.MM.yyyy HH:mm</var-value></var>
>                </field>
>                <field property="datumBisLaufzeiten" depends="date">
>                <arg position="0" key="REPORTform.datumBisLaufzeiten"/>
>        <var><var-name>datePattern</var-name><var-value>dd.MM.yyyy HH:mm</var-value></var>
>                </field>
>        </form>
> </formset>
>
> I had a look at the validateDate.js in commons-validator.jar and I think it would not do that, what I want. Has anybody an Idea what am I doing wront, or do I have to do different.
>
> Thank you in advance for your help,
> Halgurt
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org