Date:  07/16/2008 12:04:47 PM Msg ID:  003767
From:  Don Bailey Thread:  003765
Subject:  Re: JavaScript Array to foxpro
Thank you for the quick reply! But...
I don have the latest version of FoxWeb. I have used hidden form fields to transfer from javascript to VFP in the past, but what i'm dealing with now is an JavaScript ARRAY.  How can I pass an ARRAY via a hidden field?
Sent by FoxWeb Support on 07/16/2008 11:56:21 AM:
I assume you are referring to JavaScript code that is running within the browser. In order to store the data in the array to a table, you will first need to transfer it to the server.  You can either use traditional techniques, where you use JavaScript to copy the data to a hidden form field and send trigger the form's submit method, or utilize Ajax, which is more elegant and, in this case, just as easy.
If you choose to use Ajax and you have FoxWeb 4, the best approach would be to send the array in the form of a JSON string to a server page that will utilize FoxWeb's fwJSON object to convert it to a VFP array.  Please refer to the ZipSearch sample code for details.
FoxWeb Support Team
support@foxweb.com email
Sent by Don Bailey on 07/16/2008 10:43:54 AM:
I have a JavaScript array that I have built and I want to use it to update a table in VFP.  Can anybody tell me how to get at the javascript array data from vfp?

Thanks