js控制select的options的几个选中和自动添加options值
2011-06-26 18:11
543 查看
判断第几个选中
if ('${da1}' == 1) {
document.forms[0].selZqda.options[1].selected = true;
}
if ('${da2}' == 2) {
document.forms[0].selZqda.options[2].selected = true;
}
自动添加值
function ajaxArea(){
id=document.getElementById("jhd0").value;
if(id ==""){
document.getElementById("deliverArea").options.length = 0;
document.getElementById("deliverArea").options.add(new Option("请选择",""));
}else{
document.getElementById("deliverArea").options.length = 0;
buffalo.remoteCall("springMarketConditionAjax.getArea",[id,],function(reply){
ret = reply.getResult();
for(var a=0;a
if ('${da1}' == 1) {
document.forms[0].selZqda.options[1].selected = true;
}
if ('${da2}' == 2) {
document.forms[0].selZqda.options[2].selected = true;
}
自动添加值
function ajaxArea(){
id=document.getElementById("jhd0").value;
if(id ==""){
document.getElementById("deliverArea").options.length = 0;
document.getElementById("deliverArea").options.add(new Option("请选择",""));
}else{
document.getElementById("deliverArea").options.length = 0;
buffalo.remoteCall("springMarketConditionAjax.getArea",[id,],function(reply){
ret = reply.getResult();
for(var a=0;a
相关文章推荐
- js控制select的options的几个选中和自动添加options值
- 利用js给select添加option并选中该option
- JS对select动态添加options操作【IE&FF兼容】
- JS对select动态添加options操作
- JS技巧:JS对select动态添加options操作[IE&FireFox兼容]
- JS 控制select选中项
- JS技巧:JS对select动态添加options操作[IE&FireFox兼容]
- html js 清除select里的值,js控制select增删改,选中,清空, 判断控件是否存在
- JS对select动态添加options操作[IE&FireFox兼容]
- 转载:JS对select动态添加options操作[IE&FireFox兼容]
- JS对select动态添加options操作[IE&FireFox兼容]
- JS对select动态添加options操作[IE&FireFox兼容]
- JS对select动态添加options操作[IE&FireFox兼容]
- JS对select动态添加options操作[IE&FireFox兼容]
- js控制select选中显示不同表单内容
- JS 控制select选中项
- 利用js给select添加option并选中该option
- 关于js遍历list集合,获取select选中的值以及动态添加option
- JS对select动态添加options操作
- JS对select动态添加options操作[IE&FireFox兼容]