简体   繁体   English

下拉菜单确定表单的实例-PHP HTML5 CSS

[英]Drop Down Menu determines instances of a form - PHP HTML5 CSS

I'm relatively new to web-programming in general so my question may seem a little ridiculous but I've done a good amount of research and can't seem to figure out an answer... 我总体上对网络编程还比较陌生,因此我的问题似乎有些荒谬,但我进行了大量研究,似乎无法找出答案...

So I have a basic registration form that registers a competitor for a competition. 因此,我有一个基本的注册表,可以注册竞争对手的比赛。 The idea is that the school's coach would go and register all of their competitors on the same page. 这个想法是,学校的教练将在同一页面上注册所有竞争对手。 I'd like for there to be a dropdown menu that an ordinal list of numbers and when a number is selected I'd like 'n' instances of the form to show up where 'n' is the number of competitors. 我希望有一个下拉菜单,其中包含一个数字顺序列表,当选择一个数字时,我希望表格的“ n”个实例显示其中“ n”是竞争对手的数量。

Is this possible? 这可能吗? or should I just put 10 or so registration forms on the page and submit what is filled out? 还是我应该在页面上放10个左右的注册表并提交填写的内容? Thanks! 谢谢!

it is possible. 有可能的。 you would simply put the number into a get variable in the links. 您只需将数字放入链接中的get变量中。

register.php?number_of_forms=1
register.php?number_of_forms=2
register.php?number_of_forms=3

when they click the link, your register.php page would loop that many times, creating that many forms. 当他们单击链接时,您的register.php页面将循环多次,从而创建许多表格。

for ($i = 0; $i <= $_GET['number_of_forms'], $i++) {
   // print form here

}

Since the coach needs to fill out all the information, isn't it the same effort to key in form by form to register the competitors? 由于教练需要填写所有信息,难道不是要逐个表格地注册竞争对手吗? If you are new to web programming, this is the easier approach. 如果您不熟悉Web编程,这是更简单的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM