我正在创建一个具有不同表单的网站页面,这取决于用户输入加载不同的表单。
加载页面时,会询问用户是否要注册客户或卖家。根据该选择,我会将变量设置为 True 或 False 加载相关表单,到目前为止,我设法完成了很多工作,但页面只加载了背景颜色,没有其他内容(当我开始介绍 JavaScript 时开始发生这种情况)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<title>Customer/Reseller</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<!--[if IE]>
<style type="text/css">
.clear {
zoom: 1;
display: block;
}
</style>
<![endif]-->
</head>
<body>
<div class="section" id="page"> <!-- Defining the #page section with the section tag -->
<div class="header"> <!-- Defining the header section of the page with the appropriate tag -->
<h2>G51 Villain Supply</h2>
<h3>Delivering Technology </h3>
<div class="nav clear"> <!-- The nav link semantically marks your main site navigation -->
<ul>
<li><a href="index.html"> Home </a></li>
<li><a href="about.html"> About </a></li>
<li><a href="products.html"> Products </a></li>
<li><a href="app.html"> Customer/Reseller </a></li>
<li><a href="private.html"> Private </a></li>
</ul>
</div>
</div>
<div class="section" id="articles"> <!-- A new section with the articles -->
<!--start -->
<div class="line"></div> <!-- Dividing line -->
<div class="article" > <!-- The new article tag. The id is supplied so it can be scrolled into view. -->
<h2>Seller Section</h2>
<div class="line"></div>
<div class="articleBody clear">
<form action="" method="seller">
<fieldset>
<legend>Seller Registration Form</legend>
<br>Please complete </br>
<br><label for="Fname">First Name:</label></br> <input type="text" name="name" id="name"/>
<br><label for="Lname">Last Name:</label></br> <input type="text" name="name" id="name"/>
<br><label for="Contact">Contact Number:</label></br> <input type="text" name="name" id="name"/>
<br><label for="email">Email:</label></br> <input type="text" name="email" id="email" />
<p></p><p></p>
<p><label for="agree"> </label> <input type="checkbox" name="agree" id="agree" /> The information I have provided above is accurate.</p>
<p><label for="btnsubmit"> </label><input type="submit" value="Register" name="btnsubmit" id="btnsubmit" /></p>
<p></p>
</fieldset>
</form>
</div>
</div>
<!-- end -->
</div>
<div class="section" id="articles"> <!-- A new section with the articles -->
<!--start -->
<div class="line"></div> <!-- Dividing line -->
<div class="article" > <!-- The new article tag. The id is supplied so it can be scrolled into view. -->
<h2>Customers Section</h2>
<div class="line"></div>
<div class="articleBody clear">
<form action="" method="cust">
<fieldset>
<legend>Customer Registration Form</legend>
<br>Please complete </br>
<br><label for="Fname">First Name:</label></br> <input type="text" name="name" id="name"/>
<br><label for="Lname">Last Name:</label></br> <input type="text" name="name" id="name"/>
<br><label for="FAdd">First Line Address:</label></br> <input type="text" name="1stAdd" id="name"/>
<br><label for="PstAdd">Postcode:</label></br> <input type="text" name="PstAdd" id="name"/>
<br><label for="Contact">Contact Number:</label></br> <input type="text" name="name" id="name"/>
<br><label for="email">Email:</label></br> <input type="text" name="email" id="email" />
<p></p><p></p>
<p><label for="agree"> </label> <input type="checkbox" name="agree" id="agree" /> The information I have provided above is accurate.</p>
<p><label for="btnsubmit"> </label><input type="submit" value="Register" name="btnsubmit" id="btnsubmit" /></p>
<p></p>
</fieldset>
</form>
</div>
</div>
<!-- end -->
</div>
<div class="footer"> <!-- Marking the footer section -->
<div class="line"></div>
<p>Copyright 2012 - G51 Villain Supply </p> <!-- Change the copyright notice -->
<a href="#" class="up">Go UP</a>
</div>
</div> <!-- Closing the #page section -->
</body>
JavaScript 的某些块未完成,因为我不知道如何。请帮忙,谢谢。
编辑:我用没有 JavaScript 的干净工作代码替换了上面的代码。