Java Web学习笔记(六) 利用layui框架实现个人信息上传界面

实训第四天笔记
使用了layui的导航、工具集及表单框架实现的个人信息页面。

代码

<html>
<head>
<meta charset="UTF-8">
<title>注册页面title>
<link rel="stylesheet" href="../js/layui/css/layui.css">
<script src="../js/layui/layui.js">script>

<style type="text/css">
#ce {
	margin: 0px 0px 0px 400px;
}
style>

head>
<body>
	<ul class="layui-nav" align="right">
		<li class="layui-nav-item"><a href="">控制台<span
				class="layui-badge">9span>a>li>
		<li class="layui-nav-item"><a href="">个人中心<span
				class="layui-badge-dot">span>a>li>
		<li class="layui-nav-item"><a href=""><img
				src="../image/1.jpg" class="layui-nav-img">a>
			<dl class="layui-nav-child">
				<dd>
					<a href="javascript:;">修改信息a>
				dd>
				<dd>
					<a href="javascript:;">安全管理a>
				dd>
				<dd>
					<a href="javascript:;">退了a>
				dd>
			dl>li>
	ul>
	<br>
	<br>
	<br>
	<br>
	<div id="ce">
		<form class="layui-form">
			
			<div class="layui-form-item" style="left:">
				<label class="layui-form-label">姓名label>
				<div class="layui-input-block" style="width: 120px;">
					<input type="text" name="" placeholder="请输入" autocomplete="off"
						class="layui-input">
				div>
			div>
			<div class="layui-form-item">
				<label class="layui-form-label">性别label>
				<div class="layui-input-block">
					<input type="radio" name="sex" value="0" title=""> <input
						type="radio" name="sex" value="1" title="" checked>
				div>
			div>
			<div class="layui-form-item">
				<label class="layui-form-label">年龄label>
				<div class="layui-input-block" style="width: 120px;">
					<input type="text" name="" placeholder="请输入" autocomplete="off"
						class="layui-input">
				div>
			div>
			<div class="layui-form-item">
				<label class="layui-form-label">语言label>
				<div class="layui-input-block">
					<input type="checkbox" name="like[java]" title="Java"> <input
						type="checkbox" name="like[C++]" title="C++"><input
						type="checkbox" name="like[Python]" title="Python">
				div>
			div>
			<div class="layui-form-item">
				<label class="layui-form-label">城市label>
				<div class="layui-input-block" style="width: 120px;">
					<select name="interest" lay-filter="aihao">
						<option value="北京">北京option>
						<option value="上海">上海option>
						<option value="深圳">深圳option>
						<option value="青岛">青岛option>
					select>
				div>
			div>
			<div class="layui-form-item" style="margin: 0px 0px 0px 25px;">
				<label class="layui-form-label">邮件提醒label>
				<div class="layui-input-block">
					<input type="checkbox" lay-skin="switch">
				div>
			div>
			<br>
			<div class="layui-form-item layui-form-text"
				style="margin: 0px 0px 0px 25px; width: 600px;">
				<label class="layui-form-label">个人介绍label>
				<div class="layui-input-block">
					<textarea placeholder="请填写内容" class="layui-textarea">textarea>
				div>
			div>
			<br> <br>
			<div class="layui-form-item" style="margin: 0px 0px 0px 100px;">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="*">立即提交button>
					<button type="reset" class="layui-btn layui-btn-primary">重置button>
				div>
			div>
			
		form>

	div>


	<script src="../js/layui/layui.js">script>
	<script>
		//Demo
		layui.use('form', function() {
			var form = layui.form;

			//监听提交
			form.on('submit(formDemo)', function(data) {
				layer.msg(JSON.stringify(data.field));
				return false;
			});
		});
	script>
	<script>
		//注意:导航 依赖 element 模块,否则无法进行功能性操作
		layui.use('element', function() {
			var element = layui.element;
		});
	script>
	<script>
		layui.use('util', function() {
			var util = layui.util;

			//执行
			util.fixbar({
				bar1 : true,
				bar2 : true,
				click : function(type) {
					console.log(type);
					if (type === 'bar1') {
						alert('点击了bar1')
					}
				}
			});
		});
	script>
body>
html>
效果展示

Java Web学习笔记(六) 利用layui框架实现个人信息上传界面_第1张图片

你可能感兴趣的:(Java学习,Java,Web学习笔记)