473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Javascript form problems!!!!

Hello

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
  1.  
  2. <script language="javascript">
  3. function callpage(){
  4. var field = document.QuoteForm.dataset;
  5. var upload_task;
  6.        for (i = 0; i < field.length; i++) {
  7.  
  8.             if (field[i].checked == true) {
  9.                  //alert("value of "+field[i].name+" is "+field[i].value+" pwb num is "+pwb_field);
  10.               upload_task = field[i].value;
  11.             }
  12.  
  13.        }
  14.     if (upload_task == 1) {
  15.  
  16.          window.location.href = "./previousinvoices.php";
  17.         }
  18.         if (upload_task == 2) {
  19.                   window.location.href = "./previousdeliverynotes.php";
  20.         }
  21.         }
  22. </script>
  23.  
  24. <form method="post" action="" name="MyForm">
  25.  
  26. <input name="dataset" type="radio" id="quote1" value="1">
  27. <input name="dataset" type="radio" id="quote2" value="2">
  28.  
  29. <a href=# onClick=callpage(); return false;><IMG BORDER=0 NAME="send" src="../images/submit.jpg" style="border-style:none;"></a>
  30.  
  31.  
Apr 26 '07 #1
1 1089
Logician
210 100+
Expand|Select|Wrap|Line Numbers
  1. var field = document.QuoteForm.dataset;
  2. .
  3. .
  4. .
  5. <form method="post" action="" name="MyForm">
  6.  
Does this make the obvious problem any clearer?

Use the JS console, that's why it's there.
Apr 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: minstrel80232 | last post by:
Hi Everybody - I'm new to this group - I need a little help please, I am looking for a simple Javascript form I can use to sign people up for classes on a web site. I have never done a form...
7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
72
by: Stephen Poley | last post by:
I have quite often (as have probably many of you) come across HTML forms with irritating bits of Javascript attached. The last straw on this particular camel's back was a large form I was asked to...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
8
by: ryan | last post by:
that will make sure all fields are entered. make sure age is between 3- 99 and make sure the email is valid I had a decent search on google, nothing really comes up that is complete. I am...
8
by: nektir | last post by:
I have an external js file to validate a form and it works in IE and Opera, but not Mozilla Firefox. In Mozilla Firefox, the javascript console sasys "SearchForm" is not defined in the second...
2
by: mylo1968 | last post by:
Hello Experts, in the following link there is fine tool for javascript client-side form validation, as some of you I guess/hope know: ...
3
by: PrabodhanP | last post by:
I hv following javascript form validation code works in IE but not in Mozilla-Firefox ...please suggest <script type="text/javascript"> function IsNumeric(strString) // check for valid...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.