Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating date in an indexed item

Status
Not open for further replies.

WC2005

Programmer
Jul 5, 2005
1
US
Hi,
I'm trying to do date validate on a list of indexed items.

e.g.

item ...... date
-----------------
1 ...... <input box>
2 ...... <input box>
...

The entry in my validation.xml is:

<field property="localizedDueDate" depends="date" indexedListProperty="actions">
<arg0 key="validate.label.date" />
<arg1 key="validate.label.date" />

<var>
<var-name>datePatternStrict</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
<arg2 key="validate.label.date" />
</field>

The current behaviour is:

item ....date
-----------------
1 ...... 01/01/2005
2 ...... <empty>
Validation PASSES

item ....date
-----------------
1 ...... 01/01/2005
2 ...... invalid date formal
Validation FAILS

item ....date
-----------------
1 ...... <empty>
2 ...... 01/01/2005
Validation PASSES

item ....date
-----------------
1 ...... <empty>
2 ...... invalid date formal
Validation PASSES ===> Undesirable!!!!



Any help would be greatly appreciated.
WC
 
depends="date"

Somewhere there you need depends="required, date"

I think that's how it goes, but if what I'm reading is, if they leave the date area blank it should pitch an error.

Somewhere you need to add the required flag.

HtH

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top