Click to See Complete Forum and Search --> : multi-part form
janice
08-12-2003, 10:37 AM
Hi, I´m trying to send along some data from a dropdown menu to a form which is using the Enctype="multipart/form-data" attribute.
But Enctype="multipart/form-data" makes the Form collection useless, (I cant use Request.Form etc to collect the value ). But surely there must be some way to parse the data array to extract a value from the previous page.
If I type the value say 58 manually, it works but if I get the value from a dropdown menu, I get "Type mismatch" error.
Any hints/links/comments is very much appreciated.
janice
08-13-2003, 06:40 AM
hi Dave!
I have used this now for over a year.
It doesn't have problems with forms.
Please take a look at this site.
This is where I got my idea from.
http://www.stardeveloper.com:8080/articles/display.html?article=2001042501&page=3
The first page is called insert.htm
and the second page is called insert.asp.
I changed my first page to insertImage.asp.
From looking at this first page, you notice they are using
<input type="text" name="Name" value"">
If you manually type in say, 58, it will collect that and post it to the next page which in turn posts to db.
What I just did was change it from input text to dynamic dropdown so that same number can be selected from the db and inserted into this other table.
All I am getting is type mismatch.
Obviously, the number selected from the dropdown box is being misinterpreted by the insert.asp page.
I will use response.write and do some debugging to try to figure out what the problem is.
rdoekes
08-14-2003, 06:27 AM
when using the multipart enctype, you allow for upload of documents. 100% agree with Dave. It will split the submitted form into separated segments. This is different from the normal method="post" where the different form elements are grouped together in a collection, which can be read with the request.form collection.
When you are using a method for uploading files, whether it is self-build or via an com component, you first execute the Request.BinaryRead(intNumberOfBytesInTheDocument) method. When you call this method, the request.form collection cannot be used anymore. This is by design, you switch to a byte-by-byte comparison of the submitted form. I suspect the Loader class does a BinaryRead of the entire document.
The only way you can still retrieve the values from the non-upload form elements is to bypass the Request.Form and use the build in "getvalue" method.
Btw: all upload components which I have seen, work in a similar fashion.
-Rogier Doekes
janice
08-14-2003, 06:45 AM
The only way you can still retrieve the values from the non-upload form elements is to bypass the Request.Form and use the build in "getvalue" method.
I appreciate all of you guys comments.
My original post says the current method which you guys have touched on does not work.
There is got to be a workaround to collecting an object passed in from a dynamic dropdown box from one page to the next .
That is what my post is asking for.
Does anyone know the workaround to this?
janice
08-14-2003, 07:32 AM
I solved it.
I knew it would work.
I misspelled id.
sorry for the incovenience.