<html>   
<head>   
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">   
<title>phplamp站-如何向textarea标签中插入图片</title>   
<script type="text/javascript">   
    function fun() {    
        var oImg = document.createElement('img');    
        oImg.src = "/inc/4.jpg";    
        document.getElementById('test').appendChild(oImg);    
    }    
</script>   
</head>   
<body>   
<form name="form1" method="post" action="test.asp">
  <textarea name="test" cols="50" rows="20" id="test">ddddddddd</textarea>
  <img src="/inc/4_s.jpg" onClick="fun()" value="fun">
    <input type="submit" name="button" id="button" value="提交">
</form>
</body>   
</html> 上面的代码可以向文本框中添加图片,但提交表单后 如何取得图片值呢(即图片地址html)
用<%= Request("test") %> 不行啊???

解决方案 »

  1.   

    1楼正解.<html>
    <head>
    <title>phplamp站-如何向textarea标签中插入图片</title>   
    <script type="text/javascript">   
        function fun() {    
            var oImg = document.createElement('img');    
            oImg.src = "/inc/4.jpg";    
            document.getElementById('test').appendChild(oImg);   
            document.getElementById('pic').value="/inc/4.jpg";
        }    
    </script>   
    </head>   
    <body>   
    <form name="form1" method="post" action="test.asp">
      <textarea name="test" cols="50" rows="20" id="test">ddddddddd</textarea>
      <img src="/inc/4_s.jpg" onClick="fun()" value="fun">
    <input type="hidden" name="pic" id="pic">
    <input type="submit" name="button" id="button" value="提交">
    </form>
    </body>
    </html>
    用request.form("pic")获取值.
      

  2.   

    保存图片就做个上传咯,ADODB.Stream来读SRC