473,549 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript form problems!!!!

89 New Member
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 1100
Logician
210 New Member
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
1400
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 before, so I greatly appreicate any and all help, info provided. Thanks again, minstrel
7
4872
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 because then it didn't work in IE. How can I enable this javascipt form validation to work in Netscape? When I use netscape, none of the alert boxes...
72
5142
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 complete in connection with attendance at a seminar. After spending more than 15 minutes on it, I clicked on the submit button - and nothing...
7
3582
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> </head> <style type="text/css">
6
2418
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: /////////////////////////////////////////////// <% ntlogon = (Request.ServerVariables("LOGON_USER"))
8
1321
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 sure that it is out there somewhere?
8
12718
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 line function Valid() { if ((SearchForm.FirstName.value == "") && (SearchForm.LastName.value == "") && (SearchForm.Phone.value == "") &&...
2
1633
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: http://www.javascript-coder.com/html-form/javascript-form-validation.phtml I just found it and experiment with it a little. Problem now is that I couldn't find out how to validate radiobuttons with it,...
3
5550
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 numeric strings { var strValidChars = "0123456789.-"; var strChar; var blnResult = true;
0
7521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7959
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
764
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.