[thelist] arrays in java script

David Dorward evolt at david.us-lot.org
Wed Nov 12 04:11:43 CST 2003


On Wednesday, Nov 12, 2003, at 10:03 Europe/London, Shilpa wrote:
> Can anyone tell me how to send an array in client side Javascript
> through a form to another VBScript server side page!!
>
That the server side script is written in VBScript is largely 
irrelevant, you have at least a couple of options.

(1) You could encode the data using some character that you know won't 
appear in the data (e.g. if you use only numbers, you could encode 
(1,2,3,4) as a string "1x2x3x4") and then explode it in your server 
side script.

(2) You could generate a number of hidden inputs with the same name, 
and set each array item as the value of one of them.

The former means more work writing the server side code (as you'd have 
to explode it), the latter means more work on the client side (as most 
server side languages handle multiple inputs with the same name as an 
array anyway[1]).

[1] The obvious exception being PHP which requires specially formatted 
input data (i.e. the characters [ and ] at the end of the name)

--
David Dorward
http://dorward.me.uk/



More information about the thelist mailing list