当然还可以用DWRUtil.getValue("selHotel");取值。在只有一个radio时,那么document.frm.selHotel.checked 值为true或flase,DWRUtil.getValue("selHotel")的值为true或flase,radio的值为document.frm.selHotel.value即true或flase。如果有多个radio时,那么document.frm.selHotel[i].checked 值为true或flase,DWRUtil.getValue("selHotel")的值为document.frm.selHotel[i].value,radio的值为document.frm.selHotel[i].value。
<script language="javascript">
function selHotel()
{
var HotelCode ="";
var intValid = document.frm.selHotel.length;
if(document.frm.selHotel.checked == true )
{
HotelCode = document.frm.selHotel.value; }
if(intValid >1){
for(var i =0;i<document.frm.selHotel.length;i++){
//alert(document.frm.selHotel[i].checked);
if (document.frm.selHotel[i].checked== true ){
HotelCode = document.frm.selHotel[i].value;
//alert(HotelCode);
}
}
}
}
</script>
<form name="frm" action="">
<input type="radio" name ="selHotel' value="1">
<input type="radio" name="selHotel" value="2">
</form>
分享到:
相关推荐
一. jQuery 语法实例 $(this).hide() 演示 jQuery hide() 函数,隐藏当前的 HTML 元素。 $("#test").hide() 演示 jQuery hide() 函数,隐藏 id="test" 的元素。 $("p").hide() 演示 jQuery hide() 函数,隐藏...
实例 载入并执行一个JavaScript文件。 $.ajax({ type: "GET", url: "test.js", dataType: "script" });保存数据到服务器,完成后通知用户。 $.ajax({ type: "POST", url: ...
+ 匹配前一项1次或多次,等价于{1,} * 匹配前一项0次或多次.等价于{0,} ___________________________________________________________________ 4.选择,分组和引用 正则表达式的语法还包括指定选择项,对子...
目标是创建没有JavaScript,没有CSS,没有UpdatePanel,没有WebServices的Web应用程序。 支持的浏览器: IE 7.0+, Firefox 3.0+, Chrome 2.0+, Opera 9.5+, Safari 3.0+ 注:ExtAspNet基于一些开源的程序ExtJS, ...
技术栈:React/Mobx/Ant Design特点:支持12种基础类型组件(input、boolean、 date、date-time、 time、 url、textarea、number、color、radio、 select、single-select)支持11个特殊类型组件(object、array、...
-Window的实例方法GetCloseReference等以及ActiveWindow的静态方法GetCloseReference等,其中的Close全部改为Hide。 -增加TabStrip中Tab控件可关闭属性EnableClose(默认为false)以及两个方法GetShowReference和...
FCKConfig.ContextMenu = ['Generic',/*'Link',*/'Anchor',/*'Image',*/'Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField', /*'ImageButton',*/'Button','BulletedList','NumberedList','...
2.5 ExtJS对原有JavaScript对象的扩展 2.5.1 Ext.Array 2.5.2 Ext.Date 2.5.3 Ext.Function 2.5.4 Ext.Number 2.5.5 Ext.String 2.5.6 Ext.Object 2.6 本章小结 第3章 ExtJS4.0的基本功能 3.1 ExtJS组件...
\contentsline {chapter}{Contents}{2}{section*.1} {1}Java基础}{17}{chapter.1} {1.1}基本语法}{17}{section.1.1} {1.2}数字表达方式}{17}{section.1.2} {1.3}补码}{19}{section.1.3} {1.3.1}总结}{23}{...
如何去验证多个Combo Box及Radio Button组件 15.6节. 如何在一个表单内通过ToolTips来返映一个错误 15.7节. 如何使用正则表达式去定位电邮地址 15.8节. 如何使用正则表达式去验证信用卡号码 15.9节. 如何使用正则...