0

QandATable.php我有一个下面的表格,其中包含一个文件输入和一个 iframe:

var $fileVideo = $("<form action='videoupload.php' method='post' enctype='multipart/form-data' target='upload_target_video' onsubmit='return videoClickHandler(this);' class='videouploadform' >" + 
"Video File: <input name='fileVideo' type='file' class='fileVideo' /></label>" +  
"<input type='submit' name='submitVideoBtn' class='sbtnvideo' value='Upload' /></label>" + 
 "<p class='listVideo' align='left'></p>" +
"<iframe class='upload_target_video' name='upload_target_video' src='/' style='width:0px;height:0px;border:0px;solid;#fff;'></iframe></form>"); 

现在下面我有一个 jquery 代码,当文件完成上传时触发。

  function stopVideoUpload(success, videofilename){

      var result = '';
      videocounter++;

      if (success == 1){
         result = '<span class="videomsg'+videocounter+'">The file was uploaded successfully</span>';
          $('.listVideo').eq(window.lastUploadVideoIndex).append('<div>' + htmlEncode(videofilename));
      }


      return true;   
}

现在文件上传的结果和文件名由下面的代码确定。但我的问题是如何$id在文本输入中显示变量?

 <script language="javascript" type="text/javascript">
 window.top.stopVideoUpload(<?php echo $result; ?>,'<?php echo $id . $_FILES['fileVideo']['name'] ?>');
 </script> 
4

1 回答 1

0

我可能误解了您的问题,但是如果您在输入字段上更改type='text'type='hidden',则 $id 变量将位于隐藏输入中。

于 2013-01-20T00:20:13.763 回答