php中如何用javascript判断一个html控件image是否被选中,并传值 求代码,谢谢。
<inputtype="image"src="<?phpecho$base_url?>images/s3.jpg"id="m2"onclick="chengeImg('m...
<input type="image" src="<?php echo $base_url?>images/s3.jpg" id="m2" onclick="chengeImg('m2','<?php echo $base_url?>images/s30.jpg');" name="yanse" value="2"/>
展开
3个回答
展开全部
<form action= "upsend_submit.php " method= "post " enctype= "multipart/form-data " name= "frm " id= "frm " onsubmit= "return checkInput(this) ">
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<SCRIPT language=javascript>
function checkInput(frm)
{
if(frm.image0.value == " " )
{
alert( "没有选择图片! ");
return false;
}
return true;
}
function setOtherFile(str)
{
document.all.text.value =document.all.image0.value;
}
</SCRIPT>
<form action= "upsend_submit.php " method= "post " enctype= "multipart/form-data " name= "frm " id= "frm " onsubmit= "return checkInput(this) ">
<td>
<input type= "image" name= "image0 " onPropertyChange= "setOtherFile(this.value) ">
<input type= "hidden " name= "hidden " >
</td>
</tr>
<form>
function checkInput(frm)
{
if(frm.image0.value == " " )
{
alert( "没有选择图片! ");
return false;
}
return true;
}
function setOtherFile(str)
{
document.all.text.value =document.all.image0.value;
}
</SCRIPT>
<form action= "upsend_submit.php " method= "post " enctype= "multipart/form-data " name= "frm " id= "frm " onsubmit= "return checkInput(this) ">
<td>
<input type= "image" name= "image0 " onPropertyChange= "setOtherFile(this.value) ">
<input type= "hidden " name= "hidden " >
</td>
</tr>
<form>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
贴代码……
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询