1. jquery captures the Enter key:
$("html ").die().live("keydown",function(event){
if(event.keyCode==13){
//Add the logic to be processed here
}
} );
//Bind carriage return action
$('textarea[name=chattext]').keydown(function(event){
if(event.which==13){
}
});
2.jquery to get multiple selected checkbox values:
$('input[type="checkbox"][name="types"]:checked').each(function() {
types = types $(this).val() "|";
}
);
3.jquery asynchronous request method:
$.ajax({
url : "${pageContext.request.contextPath }/UOSRoleManangerAction.do?method=createRole",
type : "post",
dataType : "html",
data:{"roleName":roleName,"roleDescription":roleDescription,"roles" :roles,"types":types},
success : function(data){
var dataObj=eval("(" data ")");
if(dataObj.result){
alert("Operation successful!");
submitForm(null,"initPage");
}else {
alert("Operation failed!");
}
}
});