【问题标题】:Classic ASP get textbox value - using VBScript经典 ASP 获取文本框值 - 使用 VBScript
【发布时间】:2011-09-07 22:39:10
【问题描述】:

我正在尝试将文件上传到我的服务器。该文件正在上传,但我想获取 File1 文本框中的值。我不想要路径,我只想要我正在保存的文件名。

<html>
    <head>
     <title>File Upload</title>
    </head>
<body>
    <form name="uploadr" method="post" action="" enctype="multipart/form-data">
        File 1 : <input name="File1" type="file"/><br/><br/>
                 <input name="btnSubmit" type="submit" value="Upload files &gt;&gt;" /><br/>
                 <input name="hiddenVal" type="hidden" value="testVal" />
    </form>
</body>
</html>

我有以下 VBScript:

<% 
    Server.ScriptTimeout = 2000
    Form.SizeLimit = &H100000

    If Form.State = 0 Then 'Completed
        Form.Files.Save DestinationPath 
        response.write "<br><Font Color=green>File  (" & Form.TotalBytes \1024 & "kB) was saved to " & DestinationPath & " folder.</Font>"
        response.write(document.uploadr.hiddenVal.value())
    ElseIf Form.State > 10 then
      Const fsSizeLimit = &HD
      Select case Form.State
            case fsSizeLimit: response.write  "<br><Font Color=red>Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)</Font><br>"
            case else response.write "<br><Font Color=red>Some form error.</Font><br>"
      end Select
    End If'Form.State = 0 then

%> 

当它到达response.write(document.uploadr.hiddenVal.value()) 时,它显示“文档”变量未定义。

我需要做什么来获取文本框的值?

【问题讨论】:

    标签: vbscript asp-classic


    【解决方案1】:

    试试这个:

    response.write(UploadFormRequest("hiddenVal"))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-17
      • 1970-01-01
      相关资源
      最近更新 更多