Persits.Upload.1 and multiple checkbox

V

Vanessa

I have an ASP script which is used to upload files with Persits.Upload.1
object. But I can't get the values from mutliple checkboxes in the form like
normally.

<form method="post" ENCTYPE="multipart/form-data"....>
<input type="checkbox" name="language" value="English">English
<input type="checkbox" name="language" value="Spanish">Spanish
<input type="checkbox" name="language" value="Chinese">Chinese

Please advice!
 
L

Larry Bud

Vanessa said:
I have an ASP script which is used to upload files with Persits.Upload.1
object. But I can't get the values from mutliple checkboxes in the form like
normally.

<form method="post" ENCTYPE="multipart/form-data"....>
<input type="checkbox" name="language" value="English">English
<input type="checkbox" name="language" value="Spanish">Spanish
<input type="checkbox" name="language" value="Chinese">Chinese

Please advice!

What's your code to retrieve those values? You can't use request.form,
you need to create the Persits object such as

Set Upload = Server.CreateObject("Persits.Upload.1")
thelanguage=upload.form("language")
 
V

Vanessa

Larry,

Here is my test code:

<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then

Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.IgnoreNoPost = True
Upload.OverwriteFiles = true
Upload.SetMaxSize 3048576
Upload.SaveToMemory

Response.Write "Upload.Form(""language""): " & Upload.Form("language") &
":<BR>"

else
%>

<form method="post" action="testcheckbox.asp" enctype="multipart/form-data">
<input type="checkbox" name="language" value="English" checked>English<br>
<input type="checkbox" name="language" value="Spanish" checked>Spanish<br>
<input type="checkbox" name="language" value="Chinese" checked>Chinese<br>
<input type="submit" name="submit" value="submit">

</form>

<% end if %>

It only get the first checked values, but not all checked values. For
example, if I checked English and Spanish, only English is returned from
Upload.Form("language"). Please advice.

Vanessa
 
L

Larry Bud

Vanessa said:
Larry,

Here is my test code:

<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then

Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.IgnoreNoPost = True
Upload.OverwriteFiles = true
Upload.SetMaxSize 3048576
Upload.SaveToMemory
.....

Vanessa, you need to read the manual. I don't have Persits installed
on my machine, but since you do, you should have the Form3.asp demo
page that they're talking about.

http://www.aspupload.com/manual_simple.html
From the section titled
"Referencing Individual File and Form Items"

The Upload.Form collection is not entirely identical to Request.Form as
******it handles multi-select form items such as <SELECT MULTIPLE>
differently.*******

A multiple checkboxes with the same name are probably handled like a
select multiple.
 
V

Vanessa

Got it! Thanks Larry! :) You save my day!

Larry Bud said:
.....

Vanessa, you need to read the manual. I don't have Persits installed
on my machine, but since you do, you should have the Form3.asp demo
page that they're talking about.

http://www.aspupload.com/manual_simple.html

"Referencing Individual File and Form Items"

The Upload.Form collection is not entirely identical to Request.Form as
******it handles multi-select form items such as <SELECT MULTIPLE>
differently.*******

A multiple checkboxes with the same name are probably handled like a
select multiple.
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top