您的位置:首页 > 其它

南大软院大神养成计划第十七天

2015-12-02 12:50 232 查看
写了个表单的,用了一点点javascript的语言还有CSS的,最后设计网页的时候应该会用到

<!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=gb2312" />

<title>个人注册页面</title>

</head>

<style type="text/css">

<!--

body{font-family:"新宋体";background-color:#ff99cc;padding-top:40px}

table,tr,td{;font-family:"楷体";font-size:25px;padding-left:100px;}

h1{text-align:center;font-size:37px;color="#9900ff";}

-->

</style>

<script type="text/javascript">

function checkall(){

var hobby = document.getElementsByTagName("input");

for(var i=0;i<hobby.length;i++)

{

hobby[i].checked=true;

}

}

function clearall(){

var hobby = document.getElementsByName("hobby");

for(var i=0;i<hobby.length;i++)

{

hobby[i].checked=false;

}

}

function jingguo(){confirm("只需要拖动进度条到相应的位置就可以啦");}

</script>

<body>

<form name="forml" method="post" action="">

<table width="700" align="center" cellpadding="20" >

<h1>注册表</h1>

<tr><td>姓名:<input name="username" type="text" size="20" placeholder="您的姓名"></td></tr>

<tr><td>年龄:<input name="age" type="text" size="20" placeholder="您的年龄"></td></tr>

<tr><td>性别:<input name="sex" type="radio" value="男" checked>男

<input name="sex" type="radio" value="女">女</td></tr>

<tr><td>生日:<input name="birthday" type="date" value="" placeholder="您的生日"></td></tr>

<tr><td>职业:<select name="work"size="" >

<option value="教师" selected>教师</option>

<option value="医生">医生</option>

<option value="律师">律师</option>

<option value="演员">演员</option>

<option value="厨师">厨师</option>

</select></td></tr>

<tr><td>工作年限:<input name="workingyear" type="range" min="1" step="1" max="20" value="3" onmouseover="jingguo()" ></td></tr>

<tr><td>请选择你的业余爱好:<br>

音乐<input type="checkbox" name="hobby" id="hobby1">

登山<input type="checkbox" name="hobby" id="hobby2">

游泳<input type="checkbox" name="hobby" id="hobby3">

阅读<input type="checkbox" name="hobby" id="hobby4">

打球<input type="checkbox" name="hobby" id="hobby5">

<br>

<input type="button" value = "全选" onclick = "checkall();">

<input type="button" value = "全不选" onclick = "clearall();">

</td></tr>

<tr><td>电子邮箱:<input name="eamil" type="email" placeholder="您的电子邮箱"></td></tr>

<tr><td>备注:<textarea name="textarea" cols="40" rows="6"></textarea></td></tr>

<tr><td>

<div style="line-height:2px;font-size:20px;">

<span style="padding:0px 0 0px 10px;float:left;display:block;line-height:5px;">请等待手机验证码发来</span>

<br><br><br><br><br><br>

<input type="text" id="txtCheckCode" style="width:10%; height:20px;float:left;" maxlength="4">

<img src="/Image/Index?r=1319928256" id="imagecode" style="padding:0px 0 0px 10px;float:left;" alt="验证码"> <a href="javascript:void(0);" id="seeagain" style="display:block;float:left;line-height:22px;margin-left:5px;">看不清</a> 

</div>

</td></tr>

<tr><td>

<input type="submit" name="submit" value="提交">

<input type="reset" name="submit2" value="重置">

</td></tr>

</table>

</form>

</body>

</html>


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: