manipulate forms collection

M

Mats

Hi
Is there a way to manipulate (ie change) the items in the forms
collection. I simply want to get rid of the infamous apostrophe in input
from a form, replace ' with ''. I had hoped to be able just to make the
change and then put it back into the Form.item. Is there a way to do
this?
If not, would the best way to save the result be to build an array,
which is then used instead of the forms collection?
My programming is not making progress at the moment due to lack of time,
so I want to find out the simplest solution
Mats
 
R

Ray at

Mats said:
Hi
Is there a way to manipulate (ie change) the items in the forms
collection. I simply want to get rid of the infamous apostrophe in input
from a form, replace ' with ''. I had hoped to be able just to make the
change and then put it back into the Form.item. Is there a way to do
this?

The form collection is read-only, so no, you cannot do that.

If not, would the best way to save the result be to build an array,
which is then used instead of the forms collection?
My programming is not making progress at the moment due to lack of time,
so I want to find out the simplest solution

Why do you want to change the form data or pull it out just to put it in
something else? Aren't you processing your form data? If you really wanted
to, you could put the data in a two dimensional array as such:


Dim aForm()
Dim i
i = 0
For Each thing In Request.Form
Redim Preserve aForm(1, i)
aForm(0, i) = thing
aForm(1, i) = Replace(Request.Form(thing), "'", "''")
i = i + 1
Next

That would make the first dimension the element name, and the second one the
value, while replacing ' with ''.

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,258
Messages
2,571,033
Members
48,768
Latest member
first4landlord

Latest Threads

Top