catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Scripting Support

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 18-07-2007, 09:01 AM   #1 (permalink)
Registered User
 
Join Date: Mar 2005
Posts: 5
Persits.Upload problem

Hello everyone,

Im having a bit of a problem posting a form using the Persists Upload component.

This is a slightly simplified version of the HTML

Code:
<form name="drivingschool" method="post" action="edit.asp" enctype="multipart/form-data">
<table>
<tr>
  <td>Driving School Name</td>
  <td><input type="text" name="drivingSchoolName" value="" /></td>
</tr>
  <td><input type="checkbox" name="features" value="car" checked="checked" />Car Tuition</td>
  <td><input type="checkbox" name="features" value="motorbike"  />Motorbike Tuition</td>
</tr>  
<tr>
  <td><input type="checkbox" name="features" value="passplus" />Pass Plus</td>
  <td><input type="checkbox" name="features" value="fleet" />Fleet</td>
</tr>
<tr>
<td>Image:</td>
<td><input type="file" name="thumbnail" value="" /></td>
</tr>
<tr class="<%=rowClass()%>">
  <td>&nbsp;</td>
   <td><input type="submit" name="submit" value="Save" /></td>
</tr>
</table>
</form>

When i post the form i can get the all of the posted <input> values but the checkboxes dont seem to work as i expect.
If i tick all of the checkboxes and post the form i would expect to get a comma seperated list of the checkbox values. Instead i just get the value of the first checkbox.

Code:
  If lCase(Request.ServerVariables("Request_Method")) = "post" Then
    Set Upload = Server.CreateObject("Persits.Upload")
    iFileCount = Upload.Save
    Response.Write upload.Form("drivingSchoolName")
    Response.Write "<br />"
    Response.Write upload.Form("Features")

    [rest of the code removed to keep it easy to read]

  End If
Is this a bug in the Persists component or am i doing something stupid?!

Regards
Ian
Ianhb is offline   Reply With Quote
Old 19-07-2007, 07:47 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2004
Posts: 43
Just a quick reply here without looking at it closely. It's unlikely to be a bug in Persits because that's a very popular component. It's likely to be an error in your syntax.

I note that all checkboxes have name="features", so it may be that the upload component cannot distinguish between them, hence only one result.

Rgds

Accelerator
accelerator is offline   Reply With Quote
Old 21-07-2007, 02:26 PM   #3 (permalink)
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks for the reply.

Wouldnt that count as a bug in the component?!

It seems to work fine if i submit the form to a normal asp page and Response.Write(Request.Form("Features")). but as soon as i use introduce the upload component it only returns one value.

Last edited by Ianhb; 21-07-2007 at 02:29 PM.
Ianhb is offline   Reply With Quote
Old 21-07-2007, 02:47 PM   #4 (permalink)
Registered User
 
Join Date: Mar 2005
Posts: 5
After much searching I've found the solution, apparently it was in the manual all along!

http://www.codingforums.com/archive/...p?t-60007.html
Ianhb is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:18 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.