用jquery插件实现自动添加用户
2012-03-28 17:26
567 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery插件实现自动添加用户</title>
<script language="javascript" type="text/javascript" src="./js/jquery-1.7.1.min.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery-ui-1.8.18.custom.min.js"></script>
<!--引进css样式类库文件-->
<link rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.18.custom.css">
<script language="javascript">
$(document).ready(function(){
//注册对话框
$("#dialog-form").dialog({
autoOpen:false,
modal:true,
width:350,
height:300,
buttons:{
"添加":function(){
$("#users").append("<tr>"+"<td>"+$("#name").val()+"</td>"+"<td>"+$("#email").val()+"</td>"+"<td>"+$("#password").val()+"</td>"+"</tr>");
$(this).dialog("close");
},
"取消":function(){
$(this).dialog("close");
},
}
});
$("#create-user").click(function(){
$("#dialog-form").dialog("open");
});
});
</script>
</head>
<body>
<div class="demo">
<div id="dialog-form" title="添加用户">
<form>
<label for="name">Name</label><br>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" /><br>
<label for="email">Email</label><br>
<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" /><br>
<label for="password">Password</label><br>
<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
</form>
</div>
<div id="users-contain" class="ui-widget">
<table id="users" class="ui-widget ui-widget-content">
<tr class="ui-widget-header ">
<th>Name</th>
<th>Email</th>
<th>Password</th>
</tr>
<tr>
<td>John Doe</td>
<td>john.doe@example.com</td>
<td>johndoe1</td>
</tr>
</table>
</div>
<button id="create-user">Create new user</button>
</div><!-- End demo -->
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery插件实现自动添加用户</title>
<script language="javascript" type="text/javascript" src="./js/jquery-1.7.1.min.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery-ui-1.8.18.custom.min.js"></script>
<!--引进css样式类库文件-->
<link rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.18.custom.css">
<script language="javascript">
$(document).ready(function(){
//注册对话框
$("#dialog-form").dialog({
autoOpen:false,
modal:true,
width:350,
height:300,
buttons:{
"添加":function(){
$("#users").append("<tr>"+"<td>"+$("#name").val()+"</td>"+"<td>"+$("#email").val()+"</td>"+"<td>"+$("#password").val()+"</td>"+"</tr>");
$(this).dialog("close");
},
"取消":function(){
$(this).dialog("close");
},
}
});
$("#create-user").click(function(){
$("#dialog-form").dialog("open");
});
});
</script>
</head>
<body>
<div class="demo">
<div id="dialog-form" title="添加用户">
<form>
<label for="name">Name</label><br>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" /><br>
<label for="email">Email</label><br>
<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" /><br>
<label for="password">Password</label><br>
<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
</form>
</div>
<div id="users-contain" class="ui-widget">
<table id="users" class="ui-widget ui-widget-content">
<tr class="ui-widget-header ">
<th>Name</th>
<th>Email</th>
<th>Password</th>
</tr>
<tr>
<td>John Doe</td>
<td>john.doe@example.com</td>
<td>johndoe1</td>
</tr>
</table>
</div>
<button id="create-user">Create new user</button>
</div><!-- End demo -->
</body>
</html>
相关文章推荐
- jquery中插件实现自动添加用户的具体代码
- jquery中插件实现自动添加用户的具体代码
- jquery中插件实现自动添加用户
- jquery实现在页面加载的时自动为日期插件添加当前日期
- jquery插件实现添加用户!
- 使用jQuery插件实现添加用户
- jquery实现在页面加载的时自动为日期插件添加当前日期
- 自己动手制作jquery插件之自动添加删除行的实现
- 自己动手制作jquery插件之自动添加删除行(上)
- JQuery实现表格自动增加行,对新行添加事件
- 使用 jquery.validate.messages_cn.js 插件实现表单自动验证,出现中文乱码
- JQuery实现自动补全的插件
- 懒人部署插件实现智能、可视化更新程序,让用户不用一个文件一个文件的拷贝,有效防止少、漏更新,同时实现自动备份覆盖的文件,便于随时还原
- jQuery插件实现网页底部自动加载-类似新浪微博
- ASP.NET jQuery 实例11 通过使用jQuery validation插件简单实现用户登录页面验证功能
- jquery mutilselect 插件添加中英文自动补全
- 使用JQUERY的flexselect插件来实现将SELECT下拉菜单变成自动补全输入框
- 自己动手制作jquery插件之自动添加删除行(下)
- jQuery插件实现可输入和自动匹配的下拉框