PDA

View Full Version : checkbox object


tee
01-30-2003, 08:15 PM
I am trying to use checkboxes to collect info from a user. There are 4 checkboxes in a form. When the user checks any different combination of checkboxes and clicks on the submit button. I want it to return an html page. Each different combination of checks from the user will return a different html page.

Please can someone help. I have been working on this for a while and just can not figure it out. :(

ACJavascript
01-31-2003, 12:40 AM
You could do somthing like this...

<script language="javascript">

function check(){

if(document.checker.option1.checked){
location.href="IfCheckBox1isChecked.html"
}else if(document.checker.option2.checked){
location.href="checked2.html"
}else if(document.checker.option3.checked){
location.href="checked3.html"
}else if(document.checker.option4.checked){
location.href="checked4.html"
}else{
alert("you have to check a box first!")
}
}
</script>
_______________

<form name="checker">
<input type="checkbox" name="option1"> Option1
<BR>
<input type="checkbox" name="option2"> Option2
<BR>
<input type="checkbox" name="option3"> Option3
<BR>
<input type="checkbox" name="option4"> Option4

_____________________

I hope this has helped :D