I suggest you read my previous comments about $A, and reponseJSON.
$H is not made to iterate over arrays.
To iterate over arrays, just use each Like so:
[1, 2, 3].each(function(e) {
console.log(e)
});
Best,
Tobie
On Nov 22, 3:14 am, laf <[EMAIL PROTECTED]> wrote:
> Thanks All,
>
> I managed to get it work like so;
>
> onFormSuccess : function(transport)
> {
> var json = transport.responseText.evalJSON(true);
>
> if(json.errors.length == 0) {
> this.form.submit();
> } else {
> var errorHash = $H(json.errors);
> this.form.down('.error').show();
> errorHash.each(function(pair) {
> this.showError(pair.key, pair.value);
> }.bind(this));
> }
>
> }
>
> I still found I needed to use $H in the case that there were errors I
> needed to show the user, so that I could iterate over the array. Let
> me know if it can be improved.
>
> Regards,
> laf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---