Hi, Bob.
Thanks for responding!
I got your example to work and have a couple of questions. I'm just
learning this stuff, so my questions will, most likely, sound naive.
1. The server-side code at the top of your example...what language
is it?
2. The server-side code uses the term 'key'. Is this a term used to
describe the variables or variable names passed using the 'post'
method of a form?
3. Is the term 'key' specific to the language code in question #1,
or can it be accessed by another language? Is it part of the DOM?
4. I'm trying to keep all the code in JavaScript, and I cannot find
any reference to the term 'key' in the book I am learning from. Is
there a JavaScript equivalence for 'key' (or, an alternate way to do
this in JavaScript)?
Many thanks!
Kim
> Hi, Bob.
>
[quoted text clipped - 5 lines]
> 1. The server-side code at the top of your example...what language
> is it?
vbscript
> 2. The server-side code uses the term 'key'. Is this a term used to
> describe the variables or variable names passed using the 'post'
> method of a form?
No. It's a variable. SP provides a Request object with various properties
and collections containing data supplied by the page that issued the
request. One of the collections is called Form. Another collection is called
Querystring. Depending on the method used to submit your form, one of these
collections will contain the data from your form elements. if you use
"post", the the Form collection contains the data. If you use "get", then
the querystring collection contains the data.
Each collection has a key (the same way any collection in COM has a key)
that identifies the data contained in each element of the collection. With
vbscript, a collection can be iterated through by the key using a "for each"
statement.
> 3. Is the term 'key' specific to the language code
No. it's simply the name I chose to use for the iteration variable. I could
have used:
for each i in Request.Form
> in question #1,
No. All COM collections are keyed, and any language that can reference a COM
collection can use the key.
> Is it part of the DOM?
The DOM also has collections that can be iterated through using a key. The
DOM is not available in server-side code - only client-side.
> 4. I'm trying to keep all the code in JavaScript, and I cannot find
> any reference to the term 'key' in the book I am learning from. Is
> there a JavaScript equivalence for 'key' (or, an alternate way to do
> this in JavaScript)?
Yes, you can use an Enumerator object to iterate through the collection:
<%@ Language=JavaScript %>
<%
var e = New Enumerator(Request.Form")
if (Request.Form.Count > 0)
{
var e = new Enumerator(Request.Form)
for (; !e.atEnd(); e.moveNext())
{
Response.Write (e.item() + ": " +
Request.Form(e.item()).Item + "<BR>")
}
Response.End
}
%>
Bob Barrows

Signature
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] - 20 Feb 2005 16:05 GMT
> No. It's a variable. SP provides a Request object with various
Hmm, what happened to the "A"? It should say:
"ASP provides ... "
Bob Barrows

Signature
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"