Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > effective way to POST an array of parameter code and values

Reply
Thread Tools

effective way to POST an array of parameter code and values

 
 
jrefactors@hotmail.com
Guest
Posts: n/a
 
      12-27-2004
If we have an array of parameterCode and parameterValue, what is the
best way to POST those
information?

Approach #1, I don't think this will work

parameterCode=1A&parameterValue=1B&parameterCode=2 A&parameterValue=2B&parameterCode=3A&parameterValu e=3B

Approach #2:

parameterCode_1=1A&parameterValue_1=1B&parameterCo de_2=2A&parameterValue_2=2B&parameterCode_3=3A&par ameterValue_3=3B
Please advise. thanks!!

 
Reply With Quote
 
 
 
 
SPG
Guest
Posts: n/a
 
      12-27-2004
Why not post all the values in one param, concatenated and separated by a
delimiter?

So...

IE:

parameterCode=paramVal1|paramVal2|paramVal3 and so on..

Then in the script to read the vals, you can do this:

var paramArray = parameterCode.split("|");

which would give you an array of strings based ont he value of the
parameterCode variable

(Note: Assuming you are passing the value of the post parameter
"parameterCode" to a function..)

Bit vauge and sketchy but hopt this points you to the rigth solution

Steve

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> If we have an array of parameterCode and parameterValue, what is the
> best way to POST those
> information?
>
> Approach #1, I don't think this will work
>
> parameterCode=1A&parameterValue=1B&parameterCode=2 A&parameterValue=2B&parameterCode=3A&parameterValu e=3B
>
> Approach #2:
>
> parameterCode_1=1A&parameterValue_1=1B&parameterCo de_2=2A&parameterValue_2=2B&parameterCode_3=3A&par ameterValue_3=3B
> Please advise. thanks!!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Type/Size Property Values for VARCHAR(MAX) Stored Proc Parameter jcpc ASP .Net 2 01-26-2011 11:48 AM
Effective way to read and write into syslog in Linux systems usingC++ anjaliraman2@gmail.com C++ 1 04-22-2008 12:12 PM
is it possible to get hidden parameter values using window.opener.document.form.parameter.value. Abdul Mohsin Javascript 1 09-06-2005 03:38 PM
effective way to POST an array of parameter code and values jrefactors@hotmail.com Javascript 1 12-27-2004 09:13 PM
What is an easy and effective way to put some water-colour pictures on a website? Chris Digital Photography 4 04-30-2004 09:54 AM



Advertisments