| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 687 人关注过本帖
标题:新人求助ASP无组件上传问题
只看楼主 加入收藏
bingzhiyu3
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-14
收藏
 问题点数:0 回复次数:5 
新人求助ASP无组件上传问题
文本框为
<input name="pic" type="text" class="button1" id="pic" size="29" readonly="true">
<input class="go-wenbenkuang" type="button" name="Submit2" value="选择图片" onClick="javascript:select_pic('pic');">

upload为
<!--#include file="upload_wj.inc"-->
<%
set upload=new upload_file
if upload.form("act")="uploadfile" then
filepath=trim(upload.form("filepath"))
filelx=trim(upload.form("filelx"))

i=0
for each formName in upload.File
set file=upload.File(formName)

fileExt=lcase(file.FileExt)
if file.filesize<100 then
response.write "<script language=javascript>alert('图片类型错误或大小超过100k,请重新选择你要上传的文件!');history.go(-1);</script>"
response.end
end if
if (filelx<>"jpg") then
response.write "<script language=javascript>alert('该文件类型不能上传!');history.go(-1);</script>"
response.end
end if
if filelx="jpg" then
if fileext<>"gif" and fileext<>"jpg" then
response.write "<script language=javascript>alert('只能上传jpg、gif格式的文件!');history.go(-1);</script>"
response.end
end if
end if
if filelx="jpg" then
if file.filesize>(200*1024) then
response.write "<script language=javascript>alert('图片文件大小不能超过200k!');history.go(-1);</script>"
response.end
end if
end if

randomize
ranNum=int(90000*rnd)+10000
filename=filepath&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
%>
<%
if file.FileSize>0 then
file.SaveToFile Server.mappath(FileName)
if filelx="swf" then
response.write "<script>window.opener.document."&upload.form("FormName")&".size.value='"&int(file.FileSize/1024)&" K'</script>"
end if
response.write "<script>window.opener.document."&upload.form("FormName")&"."&upload.form("EditName")&".value='"&FileName&"'</script>"
%>
<%
end if
set file=nothing
next
set upload=nothing
end if
%>
<script language="javascript">
window.close();
</script>

错误提示window.opener.document.form2.pic为空或不是对象
请帮忙解决``万分感谢
搜索更多相关主题的帖子: 组件 ASP 新人 
2008-04-14 16:22
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
window.opener.document.form2.pic
这里的意思是在弹出窗口的父窗口的form2表单找不到pic这个元素。
2008-04-14 16:32
bingzhiyu3
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-14
收藏
得分:0 
谢谢版主的回答``不好意思麻烦能不能帮忙看看这个父窗口需要怎么修改么``
谢谢
<!--#include file="../include/DBClass.inc.asp"-->
<%
call header("阜新网上婚展")
Call Content()
call Footer()
Sub Content()%>
<link href="../css/Style.css" rel="stylesheet" type="text/css">

<script Language="JavaScript">
function FormCheck()
{
if (document.form2.user.value =="")
{
alert("请填写会员名称!");
document.form2.user.focus();
return false;
}

var filter=/^\s*[.A-Za-z0-9_-]{5,15}\s*$/;
if (!filter.test(document.form2.user.value)) {
alert("帐号填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 _ - .)长度不小于5个字符,不超过15个字符,注意不要使用空格。");
document.form2.user.focus();
document.form2.user.select();
return false;
}
        
 if (document.form2.pass.value =="")
         {
         alert("请填写密码!");
         document.form2.pass.focus();
         return (false);
         }

var filter=/^\s*[.A-Za-z0-9_-]{5,15}\s*$/;
if (document.form2.pass.value!="")
if (!filter.test(document.form2.pass.value)) {
alert("密码填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 _ - .)长度不小于5个字符,不超过15个字符,注意不要使用空格。");
document.form2.pass.focus();
document.form2.pass.select();
return false;
}

if (document.form2.confirmPassword.value=="")
    {
        alert("请输入确密码!");
        document.form2.confirmPassword.focus();
        return false;
    }

if (document.form2.pass.value!=document.form2.confirmPassword.value ){
alert("两次填写的密码不一致,请重新填写!");
document.form2.pass.focus();
document.form2.pass.select();
return false;
}

if (document.form2.Name.value=="")
  {
   alert("请输入公司名称");
   document.form2.Name.focus();
   return false;
  }
if (document.form2.contact.value=="")
  {
   alert("请输入联系人");
   document.form2.contact.focus();
   return false;
  }
if (document.form2.tel.value=="")
  {
   alert("请输入联系电话");
   document.form2.tel.focus();
   return false;
  }   
}

</script>
            
<!--#include file="../include/top3.asp"-->               
<!--#include file="../include/trank.asp"-->
<br>
<table width="775" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="FFFFFF">
                 <form Name="form2" method="post" action="regsave.asp" onSubmit="return FormCheck();" >
                 <input type=hidden name=d_savefilename>
                 <script language = "JavaScript">
function select_pic(editname)
{
  var editname=editname;
  var selPicWnd=window.open("Select.asp?formname=form2&editname="+editname+"&uppath=pic&filelx=jpg","new","resizable=yes,width=550,height=80,top=0,scrollbars=yes");
  if (selPicWnd.opener==null)
    selPicWnd.opener=self;
  return false;
  
}

            </script>
                  <tr align="center" bgcolor="f2f2f2" >
                    <td height="35" colspan="2" class="WZ_DE0"><B>阜新婚嫁网商家申请表</B></td>
                  </tr>
                  <tr bgcolor="#F2F2F2" >
                    <td height="50" colspan="2" bgcolor="#F2F2F2"> &nbsp;&nbsp;&nbsp;&nbsp;欢迎使用阜新婚嫁网为您提供的网上婚展服务,请填正确写下面的表格并提交,阜新婚嫁工作人员会进行初步审核。带<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN>号的栏目为必填项。</td>
                  </tr>
                  <tr bgcolor="#F2F2F2" >
                    <td colspan="2" bgcolor="#F2F2F2"> &nbsp;&gt;&gt; 会员信息</td>
                   </tr>
                  <tr bgcolor="f2f2f2" >
                    <td width="119" height="30" align="center">帐&nbsp;&nbsp;&nbsp;&nbsp;号&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td width="648" align="left">&nbsp;
                      <INPUT name="user" class="button1" size="20"  maxLength=20>
&nbsp;为方便记忆,您可以使用<SPAN class=red>Email地址</SPAN>作为帐号 </td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">密&nbsp;&nbsp;&nbsp;&nbsp;码&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left" >&nbsp;
                      <INPUT name=pass type=password class="button1" value="" size="20" maxLength=20>
&nbsp;除<SPAN class=color_red>空格,单、双引号外</SPAN>的任意字符,最长16位</td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">确认密码&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left">&nbsp;
                      <INPUT name=confirmPassword type=password class="button1" value="" size="20" maxLength=20>
&nbsp;请与您的密码保持一致 </td>
                  </tr>
                  <tr bgcolor="#F2F2F2" >
                    <td colspan="2">&nbsp;&gt;&gt; 公司信息</td>
                   </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">展商类别&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left" >&nbsp;
                      <select name="shtype" id="shtype">
                        <option value="1">婚庆服务</option>
                        <option value="2">婚戒首饰</option>
                        <option value="3">喜宴餐厅</option>
                        <option value="5">婚纱摄影</option>
                        <option value="6">婚庆花店</option>
                      </select></td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">公司全称&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left">&nbsp;
                    <INPUT name=Name class="button1" id="Name" size=29 maxLength=35>                    </td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">联系人&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left" >&nbsp;
                      <INPUT name=contact class="button1" id="contact" size="29"
      maxLength=29></td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">咨询电话&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left">&nbsp;
                    <INPUT name=tel class="button1" id="tel" size=29 maxlength="40"></td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">详细地址&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left"> &nbsp;
                    <INPUT name=address class="button1" size=50 maxLength=100>                    </td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">公司网址:</td>
                    <td align="left" >&nbsp;
                    <INPUT name=url class="button1" id="url" value="http://" size=35 maxLength=35>                    </td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">商家标志:</td>
                    <td align="left">&nbsp;
                      <input name="pic" type="text" class="button1" id="pic" size="29" readonly="true">
                      <input class="go-wenbenkuang" type="button" name="Submit2" value="选择图片" onClick="javascript:select_pic('pic');">
                    [尺寸:160×  150像素,注意大小不能超过50K]</td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">关键字:</td>
                    <td align="left"><span class="mode">
                      &nbsp;
<textarea name="keyword" cols="60" rows="2" id="keyword"></textarea>
                      <br />
&nbsp;&nbsp;(注:请正确填写,本栏目起搜索商家广告的作用,多关键字用|分开.)</span></td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="30" align="center">商铺简介&nbsp;<SPAN class=fontRed><FONT
color=#ff0000><B>*</B></FONT></SPAN></td>
                    <td align="left">&nbsp;                    </td>
                  </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="400" colspan="2" align="center">
                    <textarea name="d_content" style="display:none"></textarea>
                    <iframe ID="eWebEditor1" src="WebEditor/eWebEditor.asp?id=d_content&style=s_newssystem&savefilename=d_savefilename" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe> </td>
                   </tr>
                  <tr bgcolor="f2f2f2" >
                    <td height="35" colspan="2" align="center"><input type="submit" name="Submit" value=" 注册新会员 "></td>
                  </tr></form>
</table>
         


<%
end sub
 %>
<!--#include file="../include/end.html"-->
2008-04-14 16:37
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
<input name="pic" type="text" class="button1" id="pic" size="29" readonly="true">
去掉一个id="pic"试试看
<input name="pic" type="text" class="button1" size="29" readonly="true">
2008-04-14 16:41
bingzhiyu3
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-14
收藏
得分:0 
没起作用
2008-04-14 16:44
bingzhiyu3
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-14
收藏
得分:0 
还有哪位朋友能帮帮忙么```
十分感谢```急``
2008-04-14 16:50
快速回复:新人求助ASP无组件上传问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.048262 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved