Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

HTML Form - not passing parameters

My HTML form, with filefields is not posting  data,

I've set up two test pages, one with a form and one that recieves the data the first is -

<!--#include file="../Connections/Connection.asp" -->
<!--#include file="../ScriptLibrary/incPU3Class.asp" -->
<!--#include file="../ScriptLibrary/incPU3Utils.asp" -->
<!--#include file="includes/Product-Edit-RS/Select-AdditionalImages.asp" -->
<!--#include file="includes/Product-Edit-RS/Select-Product.asp" -->
<!--#include file="includes/Product-Edit-RS/Select-MainImage.asp" -->
<!--include file="includes/editproduct-image-upload.asp" -->
<!--include file="includes/product-update.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form action="test2.asp" method="post" enctype="multipart/form-data" name="newprodust" id="newprodust" onSubmit="return validatenewprodust(this)">
    <strong>Product Details</strong>
    <table border="0" cellspacing="0" cellpadding="0" class="newproducttable">
      <tr>
        <td class="fixedleftwidth">Product ID</td>
        <td><input name="id" type="text" id="id" value="id here" /></td>
      </tr>
      <tr>
        <td class="fixedleftwidth">Product Name</td>
        <td><input name="name" type="text" id="name" value="namehere" /></td>
      </tr>
      <tr>
        <td class="fixedleftwidth">Main Image <span class="asterix">*</span></td>
        <td><input name="image1" type="file" id="image1" value="imagehere"/></td>
      </tr>
      <tr class="alternativerowtr">
        <td class="fixedleftwidth">Second Image (Optional)</td>
        <td><input name="image2" type="file" id="image2" value="imagehere2" /></td>
      </tr>
      <tr>
        <td class="fixedleftwidth">Third Image (Optional)</td>
        <td><input name="image3" type="file" id="image3" value="imagehere3" /></td>
      </tr>
      <tr class="alternativerowtr">
        <td class="fixedleftwidth">Fourth Image (Optional)</td>
        <td><input name="image4" type="file" id="image4" value="imagehere4" /></td>
      </tr>
      <tr>
        <td class="fixedleftwidth">Fifth Image (Optional)</td>
        <td><input name="image5" type="file" id="image5" value="imagehere5" /></td>
      </tr>
      <tr class="alternativerowtr">
        <td class="fixedleftwidth">Sixth Image (Optional)</td>
        <td><input name="image6" type="file" id="image6" value="imagehere6" /></td>
      </tr>
  </table>
    <input type="submit" name="button" id="button" value="Submit" />
<input name="faction" type="hidden" id="faction" value="fupdate" />
</form>
</body>
</html>

Open in new window


the second is (test2.asp) -

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<p>ID : <%= Request.Form("id") %></p>
<p>Name : <%= Request.Form("name") %></p>
<p>Main Image : <%= Request.Form("image1") %></p>
<p>Image 2:</p>
<p>Image 3:</p>
<p>Image 4:</p>
<p>Image 5:</p>
<p>Image 6:</p>
<p>&nbsp;</p>
</body>
</html>

Open in new window


Nothing is getting sent across...

This is the first time I have experienced an issue like this, please advise.

Thank you
VB ScriptASPHTML

Avatar of undefined
Last Comment
garethtnash
ASKER CERTIFIED SOLUTION
Avatar of pateljitu
pateljitu
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of garethtnash
garethtnash
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

You are totally correct thank you, mind if I quickly ask you another quick question?

you may recall helping me with the following multi select combi box -

<select name="category" size="4" multiple="multiple" id="category">
<%
While (NOT RsCategoriesOptions.EOF)
%><option value="<%=(RsCategoriesOptions.Fields.Item("ID").Value)%>"<%    
        do While NOT RsSelectedCategories.EOF

            If (Not isNull((RsSelectedCategories.Fields.Item("ID").Value))) Then
                If (CStr(RsCategoriesOptions.Fields.Item("ID").Value) = CStr((RsSelectedCategories.Fields.Item("ID").Value))) Then
                    Response.Write(" selected=""selected""")
                    exit do
                end if
            End if        
     
        RsSelectedCategories.MoveNext()
        loop
 %>><%=(RsCategoriesOptions.Fields.Item("Category-label").Value)%></option>
 <%
   RsCategoriesOptions.MoveNext()
Wend
%></select>

Open in new window


I've just found a slight bug, in that if only one item was selected, nothing is displayed.. more than 1 everything is displayed...

Appreciate it if you could have a quick look -

Thank you
Avatar of pateljitu
pateljitu
Flag of Canada image

Sure glad to help:

1. @garethtnash: I've just found a slight bug, in that if only one item was selected, nothing is displayed. :
  Question: In this case is the <Select> element empty and does not display any items, if that is the case please confirm the resultset from DB for this query
RsRelatedProductOptions_cmd.CommandText = "SELECT ID, [Product-Name] FROM dbo.[Direct-Product] WHERE [Display-TGI-Direct] = 'Y' AND ID <> ? ORDER BY [Product-Name]"

basically recordset RsRelatedProductOptions should return all products available.

and

RsRelated_cmd.CommandText = "Select  R.RelatedProductID as ID from dbo. [Direct-Related-Products] R  where R.ProductID = ?"
Avatar of garethtnash
garethtnash
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Thank you
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo