- 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(){ },
------解决方案--------------------
form.submit();