Advertisement

06.13.2007 at 09:48AM PDT, ID: 22631671
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

ASP/Dreamweaver 8: How to pass value from control (drop down menu) on first page to next page.

Asked by jimmyb0004 in Macromedia Dreamweaver, Active Server Pages (ASP)

Tags: , ,

I'm using dreamweaver and asp and am new to using dreamweaver (macromedia studio 8) and i'm having an issue with a very simple process. I have a page that loops through a flat (csv) file database. It counts and displays the files first record headers, using the split function. I have the loop outputting a drop down box in front of each record field (header) after displaying the breakdown of the lists first record the user is supposed to use the drop down box next to each field so that they can put in order (using the drop down menu numbers) all of the mailing fields that I display on the side with numbers next to them. Essentially they are telling the app which split of the first record is the first name, last name..etc. I then want to check the value of each drop down box so that I can use that info to pull the first name, last name..etc.. from the file and create a query string to input only those sections of the first record into a mailing database. Since there will be no standard for the file format to be in I have to have the user tell the app where their first name, last name..etc.. fields are and then loop through the file and retrieve only those pieces so I can build a string and upload them to a database.

Now that I explained all that... The issue i'm having most is that I don't know how loop through and check before... or , when redirected to the new page, to pull the info from the post page so that I can check the values of the drop down menu to see if it is left blank or has 1, for first name, 2 for last name...etc..etc.. and then use that to go from there and then use the split function again to pull only those splits/values from the records in the file.

My basic question to start with I guess is how can I best retrieve the drop down menu values. Do I loop through with some script some how, if so...how ...help! or do i just click submit and then in the new page retrieve the values for each drop down menu box, which is what i'm trying to do so far but I don't know how to get and pass values from the drop down menus and pass from one page to another without using session variables. Would like to just on page load check the values of each box so that I can use that to choose which values to pull when I do the split of the csv file. Here's some code for what I have so far, it's pretty basic to this point..

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/conn.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>
  <table width="100%" align="center">
  <tr>
    <td width="35%"><img src="images/logo_seaway250.gif" /></td>
    <td align="left"><h1>Match your fields here!</h1></td>
  </table>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>File Location Page</title>
<script language="javascript">
function Submit_OnClick()
{
  alert("so far so good :p");
  document.all.submit();
}
</script>
</head>

<body bgcolor="#FFFFCC">
<p>Please match the proper mailing field number with the record info by putting the number in the box next to the record column.<br />If the record column doesn't belong to one of the mailing column names then leave it blank.<br />Not All numbers will always be used nor do they have to be if record info doesn't exist for that field.</p>
<p><font color="#0033FF">Here is a list of each individual column of your first record....</font></p>

<table width="100%" align="center">
  <tr>
    <td width="20%" valign="top">1.) First Name<br /><br />2.) Last Name<br /><br />3.) Company<br /><br />
      4.) Address Line 1<br /><br />5.) Address Line 2<br /><br />6.) City<br /><br />7.) State<br /><br />8.) Zip</td>
      <td>
      <%
      iCount = 0
      iColCnt = 0
      iRecCnt = 0
      Set fs=Server.CreateObject("Scripting.FileSystemObject")
      Set f=fs.OpenTextFile(Server.MapPath("Sample Database 051507.CSV"), 1)
      Do While Not f.AtEndOfStream
            sTemp = f.Readline
            if iCount = 0 then
            aTemp = Split(sTemp,",")
                        iColCnt = ubound(aTemp)+1
                        iTempCnt = 0
                        iNmCnt = 0
                        'Output each section/column of the split (determined by each coma)
                        'and break the line so each column displays on a new row.
                        Do While iTempCnt < iColCnt
                        iNmCnt = iNmCnt + 1
                        Response.Write("<SELECT NAME='ddlNum' & iNmCnt><OPTION VALUE='1'><OPTION VALUE='2'>1<OPTION VALUE='3'>2<OPTION             VALUE='4'>3<OPTION VALUE='5'>4<OPTION VALUE='6'>5<OPTION VALUE='7'>6<OPTION VALUE='8'>7<OPTION VALUE='9'>8</SELECT>- ")
                        aTemp(iTempCnt) = aTemp(iTempCnt) & "<br>"
                        Response.Write(aTemp(iTempCnt))
                        iTempCnt = iTempCnt + 1
                        Loop

            else
                        iRecCnt = iRecCnt + 1

            End If
            iCount = iCount + 1
      Loop

      f.Close
      Set f=Nothing
      Set fs=Nothing
      %>
      </td>
      <td valign="top">We're lining up the mailing fields with the data from your file...<br /> so we can import them to the mailing databases matching columns.<p>This picture gives you a graphical representation of what<br /> we are basicly doing...</p><p><img src="images/matching.jpg"/></p>
      </td>
  </tr>
  <tr>
    <td width="100%" colspan="3" align="center"><p><form action="Display.asp" method="post">
        <input type="submit" value="Submit" onclick="javascript:Submit_OnClick()" /></form></p>
      </td>
  </tr>
</table>

<%
Session("ColCnt") = iColCnt
Response.Write("<h6><font color='Red'> Num of Columns = </font><font color='Blue'>" & iColCnt & "</font><br>")
Response.Write("<font color='Red'>Record Count = </font><font color='Blue'>" & iRecCnt & "</font></h6>")
%>

</body>
</html>

That's the first page that reads the file, which I just have hard coded and in the site itself at the moment but will be read on client side later.. hopefully. On the second page I don't have anything really because I can't seem to figure out how to retrieve the values from the drop down menus on the first page "Matching.asp" so that I can deal with them on what I now have called the "Display.asp" page because I was trying to, for now, output the values just to see if I was passing and retrieving them right. I know in C# .NET all I had to really do was Request.Params.Get("blah") and it would retrieve the values from the post to the new page.

ps. I have the loop creating the drop down menu and have a count var to append a 1, 2..etc..etc to the name of the control so that the name is unique. "numlist1", "numlist2"..etc. You can see this in the code above.

Believe me.. I know this is a mess... sorry folks :/ and thx in advance.Start Free Trial
[+][-]06.13.2007 at 10:14AM PDT, ID: 19276217

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Macromedia Dreamweaver, Active Server Pages (ASP)
Tags: from, passing, vbscript
Sign Up Now!
Solution Provided By: L00M
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.13.2007 at 11:11AM PDT, ID: 19276672

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:22AM PDT, ID: 19276765

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.13.2007 at 11:40AM PDT, ID: 19276933

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:43AM PDT, ID: 19276952

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:44AM PDT, ID: 19276956

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:51AM PDT, ID: 19277009

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:54AM PDT, ID: 19277031

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:55AM PDT, ID: 19277034

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 11:55AM PDT, ID: 19277043

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 12:11PM PDT, ID: 19277174

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2007 at 12:16PM PDT, ID: 19277216

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32