简体   繁体   English

如何在HTML中创建动态页面?

[英]How to create dynamic pages in html?

I have a scenario, in this i have to develop pages containing various check box items. 我有一种情况,在这种情况下,我必须开发包含各种复选框项的页面。 User can select at least one option from that and submit the form. 用户可以从中选择至少一个选项并提交表格。

在此处输入图片说明 from the above form, user can select multiple items and proceed to next step. 从上面的表格中,用户可以选择多个项目并继续下一步。 when user submit form, i have to show next page form data on the basis of user selection. 当用户提交表单时,我必须根据用户选择显示下一页表单数据。

How can i do that in html and javascript? 如何在html和javascript中做到这一点? or do i need to create this application using php? 还是我需要使用php创建此应用程序? (i dont know php) Can you please suggest me reference links that can i follow to implement this. (我不知道php)您能建议我参考链接以实现这一点吗?

You can do it in javascript. 您可以在javascript中完成。 On submit, check the checkbox selected and redirect accordingly. 提交后,选中选中的复选框并进行相应的重定向。

You can do it using javascript. 您可以使用javascript完成。 Here's an example form: 这是一个示例表单:

<form action="response.html" name="form1" method="GET">
   <input type="text" name="param"></input>
   <input type="submit" value="submit"></input>
</form>

When you click submit it will redirect to the "action" page you specified, in my case to response.html In that page the URL will be something like www.mydomain.com/response.html?param=myanswer 单击提交后,它将重定向到您指定的“操作”页面,在我的情况下,该页面将重定向到response.html。在该页面中,URL类似于www.mydomain.com/response.html?param=myanswer

You can then pull them apart using javascript eg 然后,您可以使用javascript将它们拉开,例如

<script>
   document.write(location.search);
</script>

You just have to split this up using methods like 'split', easy to google 您只需要使用“拆分”之类的方法将其拆分即可,易于Google搜索

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

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