<input type="button" value="submit" onclick="check()">var check = function(){
var ra = document.all("radio");
var checkObj = null;
for(var i=0;i<ra.length;i++)
{
if(ra[i].checked)
{
checkObj = ra[i];
}
}
if(checkObj == null)
{
alert("必须选择一项进行操作!");
return;
}
if(checkObj.value == "move")
{
if(video_sort.value == 0 || video_sort.value == "")
{
alert("请选择要移动的位置!");
return;
}
}
return true;
}
var ra = document.all("radio");
var checkObj = null;
for(var i=0;i<ra.length;i++)
{
if(ra[i].checked)
{
checkObj = ra[i];
}
}
if(checkObj == null)
{
alert("必须选择一项进行操作!");
return;
}
if(checkObj.value == "move")
{
if(video_sort.value == 0 || video_sort.value == "")
{
alert("请选择要移动的位置!");
return;
}
}
return true;
}
<label >
<input type="radio" name="radio" value="pass" >
</label >
<label > 通过审核 </label >
<input type="radio" name="radio" value="dispass" >
<label > 取消审核 </label >
<input type="radio" name="radio" value="move" >
移动至
<select name="video_sort" >
<option value="0" >请选择所属频道 </option >
{$rows}
</select >
<input type="button" value="OK" onclick="fn_check();" >function fn_check(){
var objRdo = document.getElementByName("radio");
var objSel = document.getElementByName("video_sort");
var strVal = ""; for(var i = 0; i < objRdo.length; i++){
if(objRdo[i].checked){
strVal = objRdo[i].value;
break;
}
}
if(strVal == ""){
alert(".......");
return;
}
if(strVal == "move"){
if(objSel.value == "0"){
alert(".......");
return;
}
}
document.form.submit();
}
取消审核 <input type="radio" id="radio3" name="radio" value="move"> 移动至
<select id="video_sort">
<option value="0">请选择所属频道</option>
<option value="1" selected>aaaa</option>
</select>
<input type="button" value="提交" onclick="return readySubmit(radio3)">JS code:function readySubmit(obj)
{
//debugger
function selOptionCheck()
{
for(var i=0;i<document.getElementsByName("radio").length;i++)
{
var thisRdo=document.getElementsByName("radio")[i];
if(thisRdo.checked)
{
return true;
}
}
return false;
}
if(!selOptionCheck())
{
alert("您当前未选择要操作的项目!");
return false;
}
if(obj.checked)
{
var obj_video_sort=document.getElementById("video_sort");
if(obj_video_sort.options[obj_video_sort.selectedIndex].value=="0")
{
alert("请选择要移动的位置!");
obj_video_sort.focus();
return false;
}
}
return true;
}
==============================================================================================