如何控制重复修改??? 还有,累加的最后结果能不能放在隐藏域里? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>var cbxId="";var cbxValue="";function onValid(s,m){ if(cbxId != '') { cbxId+="";cbxValue +=""; if(cbxId.indexOf(s)!=-1) { cbxId = cbxId .replace(',' + s,'').replace(s,''); cbxValue = cbxValue .replace(',' + m.className,'').replace(m.className,''); } cbxId += ',' + s; cbxValue += ',' + m.value; m.className =m.value;//保存旧值 if(cbxId.indexOf(',')==0) { cbxId=cbxId.substring(1,cbxId.length); cbxValue=cbxValue.substring(1,cbxValue.length); } } else { cbxId = s; cbxValue = m.value; m.className=m.value;//保存旧值 }HiddenID.value=cbxId;HiddenValue.value=cbxValue;/*alert("id--"+HiddenID.value);alert("VALUE--"+HiddenValue.value);*/ }</script><input type="text" name="count" id="10" value="" onChange="onValid(10,this)"><input type="text" name="count" id="11" value="" onChange="onValid(11,this)"><input type="text" name="count" id="12" value="" onChange="onValid(12,this)"><input type="text" name="count" id="13" value="" onChange="onValid(13,this)"><input id="HiddenID" type="hidden" /><input id="HiddenValue" type="hidden" /> 求助:如何为这个菜单再加一级 求救:jQuery.js Prototype.js共存 jQuery.fn.extend 扩展jQuery非Prototype ,冲突了 js问题 高手帮忙,写个函数,谢谢了! 谁有带复选框的JS树? 关于JS编程资料和工具的问题! 菜鸟高分请教!!!!急急 在线等 请教:table数据导入到excel中,我想在打印的时候保留网格线该怎么办? 请问这个for循环如和实现。 用JAVASCIPT判断文件是否存在?在线等待,参与者都有分!!! 小弟又有新问题,想请高手解答.................. 会改的进来看!!
var cbxId="";
var cbxValue="";
function onValid(s,m){
if(cbxId != '')
{
cbxId+="";cbxValue +="";
if(cbxId.indexOf(s)!=-1)
{
cbxId = cbxId .replace(',' + s,'').replace(s,'');
cbxValue = cbxValue .replace(',' + m.className,'').replace(m.className,'');
}
cbxId += ',' + s;
cbxValue += ',' + m.value;
m.className =m.value;//保存旧值
if(cbxId.indexOf(',')==0)
{
cbxId=cbxId.substring(1,cbxId.length);
cbxValue=cbxValue.substring(1,cbxValue.length);
}
}
else
{
cbxId = s;
cbxValue = m.value;
m.className=m.value;//保存旧值
}HiddenID.value=cbxId;
HiddenValue.value=cbxValue;/*alert("id--"+HiddenID.value);
alert("VALUE--"+HiddenValue.value);*/
}</script>
<input type="text" name="count" id="10" value="" onChange="onValid(10,this)">
<input type="text" name="count" id="11" value="" onChange="onValid(11,this)">
<input type="text" name="count" id="12" value="" onChange="onValid(12,this)">
<input type="text" name="count" id="13" value="" onChange="onValid(13,this)"><input id="HiddenID" type="hidden" />
<input id="HiddenValue" type="hidden" />