Oops,

After reading your post again I think you instead might want your JSON
formed like this:

{arEmptyFields:['First Name', 'Last Name', 'Email']}

B

On Apr 23, 6:29 pm, Luke The Duke <[EMAIL PROTECTED]> wrote:
> Hi all
>
> Iam new to Prototype and I have the following question:
>
> A PHP Script (Zend Framwork) returns the following JSON Code after
> submitting a Form:
>
> {"from_firstName":{"isEmpty":"Value is empty, but a non-empty value is
> required"},"from_lastName":{"isEmpty":"Value is empty, but a non-empty
> value is required"},"from_email":{"isEmpty":"Value is empty, but a non-
> empty value is required"},"to_firstName":{"isEmpty":"Value is empty,
> but a non-empty value is required"},"to_lastName":{"isEmpty":"Value is
> empty, but a non-empty value is required"},"to_email":
> {"isEmpty":"Value is empty, but a non-empty value is required"}}
>
> Now the idea is to draw a red border around all the formfields
> mentioned in the JSON Code like 'from_firstName', 'from_lastName' etc.
>
> So i thought I could proceed the data with evalJSON() to an object and
> than use the each() method. I tried the following code:
>
> handleJSONResponse:function(transport) {
>     var data = transport.responseText.evalJSON(true);
>     data.each(function(s) {
>        alert(s);
>     });
>
> }
>
> but nothing happens.. no error, nothing. I can
> alert(transport.responseText) which returns me the JSON Code above.
> But each() doesnt return me anything.
>
> What do I do wrong?
>
> Thanks for your help!
>
> Luke The Duke
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to