بدون مزيد من اللغط ، فقط قم بتحميل الكود
نسخة الكود كما يلي:
<٪@ page language = "c#" autoeventwireup = "true" codebehind = "web2.aspx.cs" errantits = "apphect2.web2" ٪>
<! doctype html>
<html xmlns = "http://www.w3.org/1999/xhtml">
<head runat = "server">
<meta http-equiv = "content-type" content = "text /html ؛ charset = utf-8" />
<title> </title>
<script src = "jquery-1.8.0.js"> </script>
<script type = "text/javaScript">
$ (function () {
$ ("#sub"). انقر فوق (function () {
var str1 = "Zhang SAN:" + $ ("#name"). val () ؛
var str2 = "الجنس:" + $ ('الإدخال: radio [name = "sex"]: checked'). val () ؛
var shuzu = [] ؛
$ ('الإدخال: مربع الاختيار [name = "aihao"]: تم التحقق منه). كل (دالة () {// لكل منهما
shuzu.push ($ (this) .val ()) ؛ // تعيين قيمة إلى الصفيف
}) ؛
window.alert (str1 + '/n' + str2 + '/n' + "المضيف:" + shuzu) ؛
}) ؛
}) ؛
</script>
</head>
<body>
<form id = "form1" runat = "server">
الاسم: <إدخال type = "text" id = "name" /> <br />
الجنس: <إدخال type = "radio" id = "nan" name = "sex" checked = "" value = "male" /> male <input type = "radio" id = "nv"
الهوايات: <إدخال نوع = "مربع الاختيار" /> السباحة
<type type = "checkbox" name = "aihao" value = "Climbing" /> Climbing
<type type = "checkbox" name = "aihao" value = "play ball" /> play ball
<type type = "checkbox" name = "aihao" value = "cycling" /> ركوب الدراجات
<type type = "checkbox" name = "aihao" value = "read" /> read
<type type = "checkbox" name = "aihao" value = "chat" /> chat <br />
<type type = "button" id = "sub" value = "sub" /> <input type = "button" id = "b" value = "reset" />
</form>
</body>
</html>
الكود موجز للغاية ، لكنه عملي للغاية. يمكن للأصدقاء إعادة كتابته وفقًا لاحتياجات مشروعهم واستخدامه.