单选框实现联动一样的效

在项目开发的时候,遇到了一个类似联动效果的单选框效果。也就是你点击这个单选框后,另外一个单选框会默认的选中,其他的单选框不可以编辑或者可以编辑。以下是具体的需求:
<p>当收费类型为:</p><p>    一次性费用 --> 默认选中初始本金 (其他不可选)--> 计算基础都不可选(也就是那个框中没有点)</p><p>    计提式费用 --> 默认选中存续本金(其他不可选) --> 计算基础可以挑选(也就是默认选中一个后,可以两个之间来回单击选择)</p><p>    不规则费用 --> 默认选中初始本金(其他不可选) --> 计算基础不可选</p>
<%@pagelanguage="java"contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<divid="winProdBaseInfo"class="easyui-window"title="管理"data-options="modal:true,closed:true,iconCls:'icon-save'"style="width:550px;height:450px;padding:10px;">
		<divstyle="padding:10px 0 10px 60px">
	<formid="fProdBaseInfo"name="fProdBaseInfo"method="post">
	<inputid="f_glfiuuid"name="glfiuuid"type="hidden"value="">
		<table>
			<tr>
				<td>名称</td>
				<td>
					<inputclass="easyui-validatebox"type="text"id="f_feename"name="feename"data-options="required:true"maxlength="25"style="width:205px"/>
				</td>
			</tr>
			<tr>
				<td>范围</td>
				<td>
					<selectclass="easyui-combobox"id="f_targettype"name="targettype"data-options="editable:false"panelHeight="auto"style="width:210px">
							<optionvalue="">-- 请选择 --</option>
							<optionvalue="P"selected="selected">利率型</option>
							<optionvalue="V">净值型</option>
							<optionvalue="A">投资账户</option>
						</select>	
				</td>
			</tr>
			<tr>
				<td>类型</td>
				<td>
					<inputclass="easyui-validatebox"type="text"id="f_feebooktype"name="feebooktype"/>
				</td>
			</tr>
			<tr>
				<td>收费类型</td>
				<td>
					<inputtype="radio"checked="checked"name="feetype"value="0"/>一次性费用
					<inputtype="radio"name="feetype"value="1"/>计费式费用
					<inputtype="radio"name="feetype"value="2"/>不规则费用
				</td>
			</tr>
			<tr>
					<td>计费基数</td>
					<td>
						<inputtype="radio"checked="checked"name="printype"value="0"/>初始本金
					<inputtype="radio"name="printype"value="2"/>存续本金
					<inputtype="radio"name="printype"value="3"/>资产规模
					</td>			
				</tr>
				<tr>
					<td>计算基础</td>
					<td>
						<inputtype="radio"name="basis"value="0">A/360
						<inputtype="radio"name="basis"value="1">A/365
					</td>			
				</tr>
				<tr>
					<td>备注</td>
					<td>
						<inputclass="easyui-textbox"data-options="multiline:true"name="remark"style="width:210px;height:60px">
					</td>			
				</tr>
		</table>
	</form>
	</div>
	
	<divstyle="text-align:center;padding:5px">
		<ahref="javascript:void(0)"class="easyui-linkbutton"id="btn_save"οnclick="saveData()">保存</a>
		<ahref="javascript:void(0)"class="easyui-linkbutton"οnclick="closeWindow()">取消</a>
	</div>
</div>
采用控制的js方法
function addData(){		
	$('#fProdBaseInfo').form('clear'); 			//清空表单中的元素
	EasyUI.disableForm('fProdBaseInfo',false);	//设置为可编辑状态
	/*在弹出之前初始化
	 * 默认弹出 收费类型为:一次性费用 计费基数:初始本金 
	 */
	
	/*$('input[name = printype]:radio').each(function(){
		if(this.value == '0'){
			this.checked = true;
		}
	})*/
/*	$('input[name = feetype]').get(0).checked = true;
	$('input[name = printype]').get(0).checked = true;
	$('input[n

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值