Search code examples
htmlasp-classicmultipartform-dataenctype

<select multiple> and enctype="multipart/form-data"


I wonder if it is possible to use both enctype="multipart/form-data" and a select multiple. Here is the drill:

I have this html file (test.html):

<form action="action.asp" method="post" enctype="multipart/form-data" name="form1">

    <select multiple name="prof">

        <option value="1">First</option>
        <option value="2">Second</option>
        <option value="3">Third</option>

    </select>

    <input type="submit" value="Ok" name="Ok">  

</form>

When I select any of those options on my list, my action page doesn't show anything (action.asp):

<%

dim prof

prof = request.form("prof")

response.write prof 

%>     

But if I remove the enctype="multipart/form-data" in test.html, then it works.

The problem is that I am using an asp upload file component that requires this enctype="multipart/form-data". Any sugestions?

Thanks in advance.


Solution

  • if your using enctype="multipart/form-data" it must be because you are uploading a file. if you upload a file you should be using a upload component if you do you could use :

    Set yourUploadComponent = CreateObject("Your.UploadComponentClassString")
    sFormValue =yourUploadComponent.Form.Item("prof").Value