here you go ;-)</x-tad-bigger>
<x-tad-bigger><?xml version="1.0"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
<fd:validation>
<fd:javascript>
var success = true;
var items = neworder;
var quantity = widget.lookupWidget("quantity");
if (items.getOrderItems() == null && quantity.value == null) {
quantity.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("Please enter a value", false));
success = false;
}
return success;
</fd:javascript>
</fd:validation>
<fd:widgets>
<fd:field id="quantity">
<fd:label>Quantity</fd:label>
<fd:datatype base="integer"/>
</fd:field>
</fd:widgets>
</fd:form>
regards
Andrew
</x-tad-bigger>
On 16 Nov 2004, at 14:37, Jorg Heymans wrote:
No worries :)
Care to contribute your solution to the list maybe?
Regards
Jorg
beya! wrote:
Problem solved......
thanks for your help
regards
Andrew
On 16 Nov 2004, at 12:41, beya! wrote:
Hi,
I have created a widget as so:
<fd:widgets>
<fd:field id="quantity">
<fd:label>Quantity</fd:label>
<fd:datatype base="integer"/>
</fd:field>
</fd:widgets>
Quantity is an attribute of an orderitem, so what I want the
validation to do is:
1. If neworder.getOrderItems() is null, submit the form only if the
quantity field has an integer value.
2. If neworder.getOrderItems() is not null, submit the form if
quantity has an integer value or not.
How do I represent this in my widget definition?
many thanks
Andrew
------------------------------------------------------------------------
* +The home of urban music
+ http://www.beyarecords.com
*
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<<inline: beya-email.gif>>
�+The home of urban music
+ http://www.beyarecords.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
