jquery
//填数据
function ddlSmallType()
{alert('aaa');
$("#ddlSmallType").html("");
$("#ddlSmallType").append("<option value='0' selected='selected'>==请选择==</option>"); var strId=$("#ddlBigType option[selected]").attr("value"); if(strId!=0)
{
$.getJSON("ddlSmallType.aspx?Id="+strId, function (data) {
for (var i = 0; i < data.length; i++) {
$("#ddlSmallType").append($("<option></option>").val(data[i].ID).html(data[i].Cname));
};
});
}
// $("#ddlSmallType").focus();
}
$(document).ready(function(){
$("#ddlBigType").change(function () { ddlSmallType(); });//添加事件
$("#ddlSmallType").change(function () { document.getElementById("hdfSmallType").value=$("#ddlSmallType option[selected]").attr("value");});//添加事件
$("#ddlSmallType").val(0);$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg.replace(/<[^>]+>/g,""));return false;},onsuccess:function(){return true;}});$("#ddlBigType").formValidator({onshow:"<font color=\"999999\">请选择行业大类。</font>",onfocus:"所在行业大类必须选择",oncorrect:"谢谢你的配合"}).inputValidator({min:1,onerror: "你是不是忘记选择行业大类!"});
$("#ddlSmallType").formValidator({onshow:"<font color=\"999999\">请选择行业小类。</font>",onfocus:"所在行业小类必须选择",oncorrect:"谢谢你的配合"}).inputValidator({min:1,onerror: "你是不是忘记选择行业小类!"});});
存在 问题
select ddlSmallType中数据重复出现二次ddlSmallType 中 alert('aaa'); 执行二次与formValidator 冲突
动态$.getJSON 的数据时默认为select ddlSmallType中数据选择的是最后一条数据 入加上 $("#ddlSmallType").focus(); select ddlSmallType中数据重复出现二次
//填数据
function ddlSmallType()
{alert('aaa');
$("#ddlSmallType").html("");
$("#ddlSmallType").append("<option value='0' selected='selected'>==请选择==</option>"); var strId=$("#ddlBigType option[selected]").attr("value"); if(strId!=0)
{
$.getJSON("ddlSmallType.aspx?Id="+strId, function (data) {
for (var i = 0; i < data.length; i++) {
$("#ddlSmallType").append($("<option></option>").val(data[i].ID).html(data[i].Cname));
};
});
}
// $("#ddlSmallType").focus();
}
$(document).ready(function(){
$("#ddlBigType").change(function () { ddlSmallType(); });//添加事件
$("#ddlSmallType").change(function () { document.getElementById("hdfSmallType").value=$("#ddlSmallType option[selected]").attr("value");});//添加事件
$("#ddlSmallType").val(0);$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg.replace(/<[^>]+>/g,""));return false;},onsuccess:function(){return true;}});$("#ddlBigType").formValidator({onshow:"<font color=\"999999\">请选择行业大类。</font>",onfocus:"所在行业大类必须选择",oncorrect:"谢谢你的配合"}).inputValidator({min:1,onerror: "你是不是忘记选择行业大类!"});
$("#ddlSmallType").formValidator({onshow:"<font color=\"999999\">请选择行业小类。</font>",onfocus:"所在行业小类必须选择",oncorrect:"谢谢你的配合"}).inputValidator({min:1,onerror: "你是不是忘记选择行业小类!"});});
存在 问题
select ddlSmallType中数据重复出现二次ddlSmallType 中 alert('aaa'); 执行二次与formValidator 冲突
动态$.getJSON 的数据时默认为select ddlSmallType中数据选择的是最后一条数据 入加上 $("#ddlSmallType").focus(); select ddlSmallType中数据重复出现二次
解决方案 »
- 急!请教Ext.Grid的Column中的这个是什么东西?帮忙看看。
- 有没有专业开发javascript的IDE?
- 用javascript怎麼table中button行和列的index
- jquery uploadify上传同名文件的问题
- 采用jQuery获取样式表中的属性值
- JavaScript相关的奇怪现象
- 关于浮动图标
- this is a test
- 关于正则表达式中$的问题?
- 前端js怎样设置不会让用户每次访问的时候都重定向url
- 帮忙,改一段JS代码,和解释一下JS,高手请进!!!
- uncaught exception: [Exception... "Out of Memory" nsresult: "0x8007000e
alert('aaa');
var strId=$("#ddlBigType option[selected]").attr("value");
if(strId!=0){
$.getJSON("ddlSmallType.aspx?Id="+strId, function (data) {
$("#ddlSmallType").length=0;
$("#ddlSmallType").append("<option value='0' selected='selected'>==请选择==</option>");
for (var i = 0; i < data.length; i++) {
$("#ddlSmallType").append($("<option></option>").val(data[i].ID).html(data[i].Cname));
};
});
}
// $("#ddlSmallType").focus();
}
function ddlSmallType(){
alert('aaa');
var strId=$("#ddlBigType option[selected]").attr("value");
if(strId!=0){
$.getJSON("ddlSmallType.aspx?Id="+strId, function (data) {
$("#ddlSmallType").length=0;
$("#ddlSmallType").append("<option value='0' selected='selected'>==请选择==</option>");
for (var i = 0; i < data.length; i++) {
$("#ddlSmallType").append($("<option></option>").val(data[i].ID).html(data[i].Cname));
};
});
}
// $("#ddlSmallType").focus();
}
//$("#ddlBigType").formValidator({onshow:"<font color=\"999999\">请选择行业大类。</font>",onfocus:"所在行业大类必须选择只验证小类