给文本域添加回车事件
<input size="15" id="filemNameWin'" name="filemNameWin'" type="text" value="" />
$('#filemNameWin').keydown(function(e){
if(e.keyCode == '13'){
//调用业务方法
}
})
常用下拉框 项目中一般用数据字典 获取的数据是 xml格式
function select(selectId,value){
var path = $("#contextPath").val();
var str = "<option value=\"\">请选择类型</option>";
$.post(path+"/opportunityTypeManager.do",{method:'selectOption'},function(data){
$(data).find("OpportunityType").each(function() {
var id = $(this).find("opTypeId").text();
var name = $(this).find("opTypeName").text();
if(id == value){
str += "<option value=\""+id+"\" selected>"+name+"</option>";
}else{
str += "<option value=\""+id+"\">"+name+"</option>";
}
});
$("#"+selectId).html(str);
});
}