提交表单后,获取不到图片路径?
图片显示代码:
<input type="hidden" id="cImg" name="cImg" value="" />
<p class="P_textarea" style="margin-left:65px;" id="showImg">
<img src="images/kx.png" width="102" height="84" name="img" onclick="imgSrc(this.src)" />
</p>
function imgSrc(imgSrc){
document.getElementById("crdImg").value = imgSrc;
var newSrc = document.getElementById("crdImg").value;
alert(newSrc);
}
document.getElementById("crdImg").value = imgSrc;是不是应该写成
imgSrc=document.getElementById("crdImg").value;????