473,388 Members | 1,340 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,388 software developers and data experts.

Firefox form submiting problem, works fine in ie

Hello, I am having a problem with developing my form, when i click submit in ie the form validates itself and is submitted but when I open the form in firefox it will not validate or submit the form, it simply open up outlook express.... any help would be really appreciated guys..

thank you, the code of my form and javascript is below

Expand|Select|Wrap|Line Numbers
  1.                           <script language="javascript1.2">
  2.                               function validateForm(f)
  3.                 {              
  4.                                   event.returnValue = true;
  5.  
  6.  
  7.                                      if (f.name.value == "")
  8.                              {
  9.                                   alert("Sorry you must fill in the name field");
  10.                                   event.returnValue = false;
  11.                              } 
  12.  
  13.                                 z = document.forms['one'].contact.value;
  14.                                  if ((f.contact.value == "") || 
  15.                                   (isNaN(parseInt(z))) )
  16.                              {
  17.                           alert("Sorry you must enter a contact telephone number"); 
  18.                                           event.returnValue = false;
  19.                              } 
  20.  
  21.  
  22.                              if ((f.email.value.indexOf("@") == -1) || 
  23.                                  (f.email.value.indexOf(".") == -1))
  24.                              {
  25.                               alert("Sorry the email field does not contain a valid email address"); 
  26.                                   event.returnValue = false;
  27.                              }
  28.  
  29.  
  30.                                        if (document.forms['one'].catagory.options[0].selected )
  31.                              {
  32.                                   alert("you must choose a catagory");
  33.                                   event.returnValue = false;
  34.                              } 
  35.  
  36.  
  37.  
  38.                             x = document.forms['one'].loan.value;
  39.                             if (isNaN(parseInt(x))) {
  40.                            alert("Please enter in a number into the loan field");
  41.                             event.returnValue = false;
  42.                                                     }
  43.  
  44.  
  45.                 }          
  46.                               </script>
  47.  
  48.  
  49.  
  50.     <form action="mailto:SOMEEMAIL@SOMEEMAIL.com" method="post" enctype="multipart/form-data" id="one" onSubmit="validateForm(this)">
  51.                                 <fieldset>
  52.                                 <legend>Applicant</legend>
  53.  
  54.                                 <p>
  55.                                   <label for="name"><span id="ast">*</span>Full name:</label>
  56.                                   <input type="text" name="name" id="name"accesskey="n" tabindex="1"></p>
  57.  
  58.  
  59.                                 <p>
  60.                                   <label for="contact"><span id="ast">*</span>Contact Tel:</label>
  61.                                   <input type="text" name="contact" id="contact" accesskey="c" tabindex="2">
  62.                                 </p>
  63.  
  64.  
  65.                                   <label for="email"><span id="ast">*</span>Email:</label>
  66.                                   <input type="text" name="email" id="email" accesskey="e" tabindex="3">
  67.                                   <br>
  68.  
  69.                                 </fieldset>
  70.  
  71.  
  72.                                 <fieldset>
  73.                                 <legend>Income Details</legend>
  74.  
  75.                               <p>Employment type:</p>
  76.  
  77.     <label for="employ" style="width:8em; margin:0; text-align:left;" >Empolyed
  78.     <input type="checkbox" name="employ" value="employed" id="employ" accesskey="m" tabindex="4">
  79.     </label>
  80.     <label for="self" style="width:8em; margin:0; text-align:left;" >Self employed
  81.     <input type="checkbox" name="self" value="self-employed" id="self" accesskey="s" tabindex="5" >
  82.     </label><br/><br/>
  83.     <p><label for="sal">Salary:</label>
  84.       <input type="text" name="sal" id="sal" accesskey="s" tabindex="6">
  85.     </p>
  86.                               </fieldset>
  87.  
  88.                                 <fieldset>
  89.                                  <legend>Mortage details</legend>
  90.                                  <p>
  91.                                    <label for="cat"><span id="ast">*</span>Catagory:</label>
  92.  
  93.                                  <select name="catagory" accesskey="v" tabindex="7" id="cat" >
  94.  
  95.                                  <option>Please Select</option>
  96.                                     <option>Commercial</option>
  97.                                     <option>First Time Buyer</option>
  98.                                     <option>100% Mortgage</option>
  99.                                     <option>Re-Mortgage</option>
  100.                                     <option>Trading Up</option>
  101.                                     <option>Investment</option>
  102.                                     <option>Self Build</option>
  103.                                  </select></p>
  104.  
  105.                                  <p>
  106.                                    <label for="loan"><span id="ast">*</span>Loan amount:</label>
  107.                                     <input type="text" name="loan" id="loan" accesskey="l" tabindex="8"></p>
  108.  
  109.                                 </fieldset>
  110.  
  111.              <input type="submit" name="Sub" id="sub" tabindex="9" value="Submit application" style="margin-top:10px;">
  112.  
  113.     <input name="clearpage" id="clearpage"type="reset" tabindex="10" value="Clear form" style="margin-top:10px;">
  114.  
  115.  
  116.  
  117.                             </form>
  118.  
Apr 6 '07 #1
2 2578
drhowarddrfine
7,435 Expert 4TB
I'm not much of a javascript guy but your html has a lot of errors. Validate and fix those.
Apr 6 '07 #2
AricC
1,892 Expert 1GB
FYI, never post your email address in a public place. That is a great way to get spammed like crazy. The reason your form opens in Outlook Express is that your form action is mailto:
Apr 6 '07 #3

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

Similar topics

8
by: Greg A | last post by:
Hi: I have my index.php page. For the header, sidebar, and footer, those are separate php pages that I call into the index.php page. My sidebar.php page has a form in it, that works fine if...
1
by: Pat | last post by:
Here is how I have been submiting a form to a popup window, this works fine for all netscape versions and all IE versions previous to 6.0.2800.1106. Does anyone know a different way I can submit a...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
3
by: TJS | last post by:
I am finding that the serverside requiredvalidator doesn't fire in the firefox browser, and user request proceeds through to my updateProfile method. Validation is working correctly in the IE...
6
by: goober | last post by:
Ladies & Gentlemen: I have built a form that client-side validates and posts data to a CRM beautifully in Internet Explorer (IE) 6. The problem comes in FireFox (FF) 1.5 when everything works...
4
by: puja | last post by:
hi all, I have an asp.net website where am including .css file dynamically on page load event. For diff users, there is diff CSS file. So after user logs in, I am setting CSS href on page load....
9
by: Dave | last post by:
Hi, I've been trawling the web for answer to my problem with no luck although I'm hardly alone it seems! Below is the generated source for an ASP page that posts a value called 'album' to...
1
by: raju78.k | last post by:
Hi, I have a problem with FireFox. I have written a function to Add rows without submiting the form. This function works fine in IE, but not in FireFox. The function is : function...
7
by: mohammed.naghman | last post by:
Hi, I have 2 submit buttons in a jsp page. One of them takes me to page2.jsp and also passes the values enetered to page2.I have a link in the page2 that does a history.back to come to the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.