WEB Select won't submit values to ASP

Discussion in 'OT Technology' started by A Cow, Mar 11, 2008.

  1. A Cow

    A Cow OT Supporter

    Joined:
    Jul 7, 2005
    Messages:
    33,022
    Likes Received:
    95
    Location:
    Vancouver BC
    hey im having some problems and i can't for the life of me figure it out

    Code:
    Filename = "C:\ASP\paypal\login\" + request.form("user") + ".txt"
    
    LongAssString = "<select name='list1'>"
    
    
    
    
    
    set FSO = server.createObject("Scripting.FileSystemObject")
    
    if FSO.FileExists( Filename ) Then
        ' get a hndle to the file
        
        set file = FSO.GetFile( filename )
    
        'get some info about the file
        
        FileSize = file.Size
    
        
        Set TextStream = file.OpenAsTextStream( ForReading, TristateUseDefault )
        
    
        Do 
            if TextStream.AtEndOfStream = true then
                exit do
            end if
    
            
            Line = TextStream.readline
    
            If Line = "Course0:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course1:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course2:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course3:" Then
                Line = TextStream.readline 
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course4:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course5:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course6:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
    
            End If
            If Line = "Course7:" Then
                Line = TextStream.readline
                LongAssString = LongAssString + "<option value='" + Line + "'>"
                LongAssString = LongAssString + Line
                LongAssString = LongAssString + "</option>"
            End If
        loop    
            
    
    end if
        response.Write LongAssString
    
    %>
    
    
        <input style="margin-top:4" type=submit value="Upload">
        </form>
    <%
    
    
    this makes a dropdown box with some dynamic values in it ( read from a textfile )

    Code:
    <%
    
    option explicit
    Response.Expires = -1
    Server.ScriptTimeout = 600
    %>
    <!-- #include file="freeaspupload.asp" -->
    <%
    Dim Upload
    Dim Email
    Dim uploadsDirVar
    
    Set Upload = New FreeASPUpload
    
    uploadsDirVar = "C:\ASP\paypal\upload\"
    'uploadsDirVar = "C:\ASP\paypal\upload\[email protected]\VG3327"
    
    email = session("email")
    
    uploadsDirVar = uploadsDirVar + email + "\" 
    'uploadsDirVar = uploadsDirVar + Upload.form("list1") 
    response.write Upload.form("list1")
    'response.Write Request.form("list1")
    
    function SaveFiles
        'Dim Upload, fileName, fileSize, ks, i, fileKey
        Dim fileName, fileSize, ks, i, fileKey
    
        'Set Upload = New FreeASPUpload
        Upload.Save(uploadsDirVar)
    
        ' If something fails inside the script, but the exception is handled
        If Err.Number<>0 then
            response.write Err.Number
            response.Write uploadsDirVar
            Exit function
        end if
    
        SaveFiles = ""
        ks = Upload.UploadedFiles.keys
        if (UBound(ks) <> -1) then
            SaveFiles = "<B>Files uploaded:</B> "
            for each fileKey in Upload.UploadedFiles.keys
                SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
            next
        else
            SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
        end if
        SaveFiles = SaveFiles & "<br>Enter a number = " & Upload.Form("enter_a_number") & "<br>"
        SaveFiles = SaveFiles & "Checkbox values = " & Upload.Form("checkbox_values") & "<br>"
    end function
    
    
    
    %>
    
    <HTML>
    <HEAD>
    <TITLE>Test Free ASP Upload</TITLE>
    <style>
    BODY {background-color: white;font-family:arial; font-size:12}
    </style>
    <script>
    function onSubmitForm() {
        var formDOMObj = document.frmSend;
        if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" )
            alert("Please press the browse button and pick a file.")
        else
            return true;
        return false;
    }
    </script>
    
    </HEAD>
    
    <BODY>
    
    <%
    response.write SaveFiles()
    %>
    
    SUPSOTED to retrive the files from said combo box but it doesn't.. it gives me a null value..

    does anyone know how to submit a value from a <select> tag and read it in just plain old asp?
     

Share This Page