Reputation: 451
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.
Upvotes: 0
Views: 1827
Reputation: 315
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 e.g.
<script>
document.write(location.search);
</script>
You just have to split this up using methods like 'split', easy to google
Upvotes: 1
Reputation: 2191
You can do it in javascript. On submit, check the checkbox selected and redirect accordingly.
Upvotes: 1