ASP实验报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
武汉科技大学实验报告课程名称 .NET架构
专业班级软件工程1001班
姓名邓仕军
学号 201013138026
实验1 HTML编程
实验目的
掌握HTML主要标签用法。
了解JS函数的基本用法。
实验内容
使用HTML设计一个个人信息注册页面。如下图所示。当点击“提交”按钮时,在当前页面显示录入信息。(要求:利用JS技术)
实验步骤
代码清单:
function show(form) {
var msg = "";
with (form) {
var username = "用户名:" + username.value + "
";
msg += username;
var pwdstr = "密码:" + pwd.value + "
";
msg += pwdstr;
var repwdstr = "确认密码:" + repwd.value + "
"; msg += repwdstr;
var sexstr = "性别:";
for (var i = 0; i < sex.length; i++) {
if (sex[i].checked == true)
sexstr += sex[i].value;
}
sexstr += "
";
msg += sexstr;
var hometown = "籍贯:";
var index = province.selectedIndex;
if (index != 0) {
var pro = province.options[index].innerText;
hometown += pro + "省";
}
var index2 = city.selectedIndex;
if (index2 != 0) {
var cit = city.options[index2].innerText;
hometown += cit + "市";
}
hometown += "
";
msg += hometown;
var emailstr = "Email:" + email.value + "
";
msg += emailstr;
var phonestr = "手机号:" + phonenum.value + "
"; msg += phonestr;
var profs = prof.options;
var profstr = "专业擅长:";
for (var i = 0; i < profs.length; i++) {
if (profs[i].selected == true) {
profstr += profs[i].value;
}
}
profstr += "
";
msg += profstr;
var habbystr = "业余爱好:";
var hab = document.getElementsByName("habby");
for (var i = 0; i < hab.length; i++) {
if (hab[i].checked == true)
habbystr += hab[i].value;
}
habbystr += "
";
msg += habbystr;
var birthdaystr = "出生年月:" + birth.value + "
"; msg += birthdaystr;
var otherstr = "备注信息:" + other.value + "
";
msg += otherstr;
var sp = document.getElementById("sp");
sp.innerHTML = msg;
}
return false;
}
function procity() {
var arr = [["请选择"],
["武汉", "恩施", "黄石", "宜昌"],
["海淀", "潮阳", "丰台", "石景山"],
["湘潭", "长沙", "衡阳", "韶山"]];
var index = document.getElementById("proID").selectedIndex;
var citys = arr[index];
var subselNode = document.getElementById("cityID");
subselNode.options.length = 0;
for (x = 0; x < citys.length; x++) {
var cityNode = document.createElement("option");
cityNode.innerText = citys[x];
subselNode.appendChild(cityNode);
}
}