[jifty-devel] Re: [Jifty-commit] r2043 - jifty/trunk/share/web/templates/__jifty

Wolfgang Kinkeldei wolfgang at kinkeldei.de
Sat Oct 21 04:35:42 EDT 2006


Am 20.10.2006 um 20:43 schrieb Jesse Vincent:

>
> Wolfgang:
>
> Can you describe a bit about how it was broken and how it now works
> right? (Not totally obvious from the change)

sorry, I should have done that.

>> -        } elsif ( not defined $action->argument_value($arg)
>> -            or length $action->argument_value($arg) == 0 ) {
>> +        } elsif ( not $action->arguments->{$arg}->{mandatory}
>> +		  and (not defined $action->argument_value($arg)
>> +                       or length $action->argument_value($arg) ==  
>> 0 ) ) {

during AJAX validation, all empty fields are accepted regardless if  
they are marked mandatory or not.

When an action validates a request's form data, however, the  
validation will correctly reject empty but mandatory fields. This  
results in thinking a form being correct when leaving a mandatory  
field empty during form entry having only the AJAX validation.

By extra testing the 'mandatory' flag in case of the field being  
empty, the message 'you should fill this out' will be displayed as  
soon as the AJAX validation is run, doing the same validation as  
server side when submitting the form.


Wolfgang

-- 

' /\_/\ ' .print[split??,"".(($/=q|Cms)+-03467:;<=|)=~tr!C-z -B! -z!)x
'( o.o )' .$/]->[hex]foreach split qr<>,qq+1ecd039ad65b025b8063475b+||
' > ^ < ' .q<!-- Wolfgang Kinkeldei - mailto:wolfgang at kinkeldei.de -->



More information about the jifty-devel mailing list