I have a problem with my javascript. I have made a small form on my website containing a few radiobuttons. When a user selects a radiobutton and hits the next button it should take him to a certain url. but NOTHING happens.........!
Here is my code, please help my figure out what's wrong. Thank you!
Expand|Select|Wrap|Line Numbers
- <script language="javascript">
- function callpage(){
- var field = document.QuoteForm.dataset;
- var upload_task;
- for (i = 0; i < field.length; i++) {
- if (field[i].checked == true) {
- //alert("value of "+field[i].name+" is "+field[i].value+" pwb num is "+pwb_field);
- upload_task = field[i].value;
- }
- }
- if (upload_task == 1) {
- window.location.href = "./previousinvoices.php";
- }
- if (upload_task == 2) {
- window.location.href = "./previousdeliverynotes.php";
- }
- }
- </script>
- <form method="post" action="" name="MyForm">
- <input name="dataset" type="radio" id="quote1" value="1">
- <input name="dataset" type="radio" id="quote2" value="2">
- <a href=# onClick=callpage(); return false;><IMG BORDER=0 NAME="send" src="../images/submit.jpg" style="border-style:none;"></a>