简体   繁体   中英

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? or do i need to create this application using php? (i dont know php) Can you please suggest me reference links that can i follow to implement this.

You can do it in javascript. On submit, check the checkbox selected and redirect accordingly.

You can do it using 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

You can then pull them apart using javascript eg

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

You just have to split this up using methods like 'split', easy to google

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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