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

onsubmit function works in Firefox & Chrome but not IE7

I have a very simple form that works fine in FF and Chrome but not IE. And by 'not work' I mean that IE complains 'object expected'. What am I missing?

TIA,

---JC

Expand|Select|Wrap|Line Numbers
  1.  <form name="myform" onsubmit="return validate(this)" method="post">
  2.  
  3.  E-Mail: <input type="text" name="email" size="40" />
  4.  Password: <input type="password" name="password" size="12" />
  5.  
  6.  <input type="submit" value="submit" id="my_submit"  /></p>
  7.  
  8. </form>
  9.  
  10.  
  11.  
  12. function validate(form)
  13. {
  14.   var email = form.email.value;
  15.   var password = form.password.value;
  16.   var errors = [];
  17.  
  18.   if (!checkLength(email)) {
  19.    errors[errors.length] = "You must enter an e-mail address.";
  20.   }
  21.  
  22.   if (!checkLength(password)) {
  23.    errors[errors.length] = "You must enter a password.";
  24.   }
  25.  
  26.   if (errors.length > 0) {
  27.    reportErrors(errors);
  28.    return false;
  29.   }
  30.  
  31.   form.action ="dl4.php?f=downloads/5061h.zip&e=" + email + "&p=" + password;
  32.  
  33.   return true;
  34. }
Jul 29 '10 #1
2 2158
@JC Harris
If checkLength() and reportErrors() are present, there should be no error. Otherwise you must show a live example.
Jul 31 '10 #2
@Logic Ali
http://kiltel.com/patch.htm

Any ideas?

TIA,

---JC
Aug 2 '10 #3

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

Similar topics

3
by: atomo | last post by:
Hi, i'm wondering why this hiding and showing function works on IE (6) but it doesn't work in Mozilla Firebird (0.7) function fnc_show(num){ for(i=1;i<7;i++){ eval("t_" + i + ".style.display...
6
by: Martin Holmgaard | last post by:
I have written the following function to be used for flood filling in a bitmap. The function works fine on Windows XP Prof and Windows 2000 server, but on Windows 2003 server it return a stack...
18
by: James Radke | last post by:
Hello, We are currently using a user DLL that when working in VB 6.0 has a user defined type as a parameter. Now we are trying to use the same DLL from a vb.net application and are having...
2
by: Armin | last post by:
Hello I want get the Screen Coordinates of a Control. I do this with Control.PointToScreen. vlob_Point = Me.PointToScreen(New System.Drawing.Point(0, 0)) This works fine with a Single...
4
by: kongkolvyu | last post by:
Hi The strptime function works just fine on Solaris. Here is an example on how I use it: struct tm tmpTm; if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm)==NULL) printf("Error,String convert...
0
by: Crystal | last post by:
I have created a small program that prints out an organization chart in PHP using the GD lib's imagecreate, imageline and imagestring functions. Basically, a user selects an employee from a...
3
by: Bob | last post by:
I have a small JS function to edit "code". This function works as intended in Firefox, but not IE 6 or Opera 9. I suppose this is an old story, but is there a work around? I have two forms on the...
0
by: Chris | last post by:
I have a list and it's rowsourcetype is set to the function get_databases_DIR. Function works without any problem in MDB, but not in MDE (nothing is returned). If Static was the problem, since I am...
1
by: pilafi | last post by:
void CSVImageIO::Read( void * buffer) { char onedataline; char *tmp=0; double d=0; unsigned short data=0; unsigned short * inptr = static_cast< unsigned short * >( buffer ); unsigned...
4
by: Hotice | last post by:
I have a form for registering some bookings. The problem is that I want to validate the data users enter in this form. All works fine, excepting the booking hours (ready by and closing time). This...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.