用脚本实现据radio是否checked对action进行更改,从而达到更新目的
2007-11-18 22:55
369 查看
星期五 2007年03月16日
用脚本实现据radio是否checked对action进行更改,从而达到更新目的
<%
var checktype = 0;
%>
<form name="check_form" id="check_form" action="" method="POST" >
<tr>
<td height="35" colspan="2" bgcolor="#D4D3CE" >请选择类型
<input type="radio" name="check_type" value="0" onclick="javascript:refreshtype()" <%if (checktype==0) out.println("checked=/"checked/"");%> >类型0
<input type="radio" name="check_type" value="1" onclick="javascript:refreshtype()" <%if (checktype==1) out.println("checked=/"checked/"");%> >类型1
</td>
</tr>
<form>
<script type="" language="javascript">
function refreshtype(){
var radios = document.check_form.check_type;
var checkedtype;
for (var i=0; i < radios.length; i++){
if (radios[i].checked){
checkedtype = radios[i].value; break;
}
}
//测试
alert("类型"+checkedtype);
document.getElementById("check_form").action = "<%=request.getContextPath()%>/Manage.do?method=show&Type="+checkedtype;
document.getElementById("check_form").submit();
return true;
}
</script>
根据radio是否checked对action进行更改,从而达到更新目的.
用脚本实现据radio是否checked对action进行更改,从而达到更新目的
<%
var checktype = 0;
%>
<form name="check_form" id="check_form" action="" method="POST" >
<tr>
<td height="35" colspan="2" bgcolor="#D4D3CE" >请选择类型
<input type="radio" name="check_type" value="0" onclick="javascript:refreshtype()" <%if (checktype==0) out.println("checked=/"checked/"");%> >类型0
<input type="radio" name="check_type" value="1" onclick="javascript:refreshtype()" <%if (checktype==1) out.println("checked=/"checked/"");%> >类型1
</td>
</tr>
<form>
<script type="" language="javascript">
function refreshtype(){
var radios = document.check_form.check_type;
var checkedtype;
for (var i=0; i < radios.length; i++){
if (radios[i].checked){
checkedtype = radios[i].value; break;
}
}
//测试
alert("类型"+checkedtype);
document.getElementById("check_form").action = "<%=request.getContextPath()%>/Manage.do?method=show&Type="+checkedtype;
document.getElementById("check_form").submit();
return true;
}
</script>
根据radio是否checked对action进行更改,从而达到更新目的.
相关文章推荐
- sqlDependency提供了这样一种能力:当被监测的数据库中的数据发生变化时,SqlDependency会自动触发OnChange事件来通知应用程序,从而达到让系统自动更新数据(或缓存)的目的.
- C++实现线程同步的几种方式 线程同步是指同一进程中的多个线程互相协调工作从而达到一致性。之所以需要线程同步,是因为多个线程同时对一个数据对象进行修改操作时,可能会对数据造成破坏,下面是多
- 如何使用命令行更改文件以及文件夹的访问控制权限,从而达到最高权限控制文件的目的
- struts2 在拦截器进行注入(依据Action是否实现自己定义接口)
- struts2 在拦截器进行注入(根据Action是否实现自定义接口)
- 使用shell脚本实现在liunx上进行svn的上传下载更新功能
- 分享实现web用户控件调用.aspx页面里的方法(从而达到访问母页面中控件的目的)
- ionic3 实现app版本更新下载并打开进行安装
- 怎样判断js脚本是否加载完,并在加载完后进行操作
- shell脚本实现批量测试局域网主机是否在线
- linux脚本-判断进程是否存在,从而可以做预警处理..
- js动态更改Form表单action,进行提交
- 9-18 ASP第二讲实现数据的真实操作,从txt文件中读取进行校对,判断登陆是否成功
- Struts2 基于XML配置方式实现对action的所有方法进行校验
- Hybrid模式-利用AssetsManager实现在线更新脚本文件lua、js、图片等资源(免去平台审核周期)
- 项目运行时判断是否第一次打开而进行的跳转以及引导页ViewPager的实现
- ibatis3中直接在xml中写明一对多的关系和利用ibatis的拦截器进行SQL重组达到分页的目的
- GridView实现双击进行编辑,更新
- 简单实现stm32f103芯片usb模拟U盘进行IAP更新用户程序