当前位置: 代码迷 >> JavaScript >> jQuery的dialog里的buttons如何弄.
  详细解决方案

jQuery的dialog里的buttons如何弄.

热度:116   发布时间:2012-09-10 11:02:32.0
jQuery的dialog里的buttons怎么弄...
JScript code

function createLoginDialog(){
var obj = $("<div></div>").attr("title","create one dialog!").attr("id","dialogTest");
var form = $("<FORM></FORM>").attr("name","loginForm").attr("onSubmit","return check()").attr("action","doManage/doLogin.jsp").attr("method","post");
var divForm = obj.append(form);
var username = $("<lable></lable>").text("用户名:");
objobj = divForm.append(username);
var userinput = $("<input type='text' name='username'>");
objobj = divForm.append(userinput);
var br = $("<br>");
divForm.append(br);
var password = $("<lable></lable>").text("密    码:");
objobj = divForm.append(password);
var passinput = $("<input type='password' name='password'>");
objobj = divForm.append(passinput);
divForm.addClass('flora').dialog({
width:350,
height:200,
resizable:'disable',
buttons:{
'OK':function(){
},
'Cancel':function(){
$(this).dialog('close');
}
},
title:'登陆',
});
}



我基本写的差不多了...我是初学者,接触jQuery才2天...
我想问下
JScript code
'OK':function(){
},
里应该怎么写才能在点击ok时像正常表单中的button一样进入Form中的action?

------解决方案--------------------
form.submit();
  相关解决方案