HTML帮助:制作实时数量计数器

时间:2017-03-21 22:50:51

标签: html

嘿,所以在我的工作中,我们有一个活动即将到来,我们有点预留座位。事实上,我们更多地看到有多少人参加此次活动,并且让人们报名参加,以了解有多少座位是开放的。我们想要一些非常基本和简单的东西我会将当前的HTML代码链接到您。如果您看一下它,您将看到4个“服务”,每个服务数量为500。然后选择选择1-10个席位。我们想要的基本功能是选择你想要多少个座位,然后选择“保留座位”,然后输入你的名字。然后计数器将减去您从该500号码中选择的座位数,并保持该号码更新以供所有人查看。然后在0,您将无法选择该服务。

在我的脑海里看起来很容易,但我对HTML很感兴趣并且不知道如何实现它。

提前致谢!

代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Language" content="en-us" />
	<meta http-equiv="content-type" content="text/html; utf-8" />
	<title>Wildwood Calvary Chapel - Easter Seat Request Form</title>
	
</script>
</head>
<body>
	<font size=+4><p><center>Wildwood Calvary Chapel </center></p></font>	
	<font size=+3><p><center>Easter Service Seats 2017</center></p></font>
		<form action="#" method="post" name="ticketForm">
			<div><font size=+2>
              <center>SELECT A SERVICE BELOW:<center><ul></h4>
                <BR>
              
				<center><label for="Yellow"><input type="radio" id="Yellow" name="service_number" value="30" />
									Saturday, April 15&nbsp;6:00 PM&nbsp;&nbsp;(500 SEATS LEFT)&nbsp;&nbsp;
								</label></center>
								<br>
							
							
								<center><label for="green"><input type="radio" id="green" name="service_number" value="31" />
									Sunday, April 16&nbsp;8:00 AM&nbsp;&nbsp;(500 SEATS LEFT)&nbsp;&nbsp;
								</label></center>
								<br>
							
							
								<center><label for="blue"><input type="radio" id="blue" name="service_number" value="32" />
									Sunday, April 16&nbsp;9:45 AM&nbsp;&nbsp;(500 SEATS LEFT)&nbsp;&nbsp;
								</label></center>
								<br>
							
							
								<center><label for="red"><input type="radio" id="red" name="service_number" value="33" />
									Sunday, April 16&nbsp;11:30 AM&nbsp;&nbsp;(500 SEATS LEFT)&nbsp;&nbsp;
								</label></center>
								<br>
							
							</ul></center><br>
				</div>
		
		<center><table>
		<tr>
			<td>
				<label for="request">Number of Seats:</label>
			</td>
		<td><select id="request" name="request">
				<option value="1" selected="selected">1</option>
				<option value="2">2</option>
				<option value="3">3</option>
				<option value="4">4</option>
				<option value="5">5</option>
				<option value="6">6</option>
				<option value="7">7</option>
				<option value="8">8</option>
				<option value="9">9</option>
				<option value="10">10</option>
			</select>
		</td>
		</tr>
		<tr>
			<td>
				<label for="name">Your Name:</label>
			</td>
			<td>
				<input type="text" id="name" name="name" />
			</td>
		</tr>
		
		
				<tr>
			<td>
				
			<tr><td></td><td><input type="submit" name="submit" value="Reserve Seats" /></td></tr>

1 个答案:

答案 0 :(得分:0)

用html无法解决这个问题。您将需要服务器端存储。您可以使用javascript在向服务器发送内容后以及在得到肯定响应后更新席位数。所以你需要在服务器端开始编写脚本,这不能用html完成。

我建议学习php和javascript来解决这个问题。