onsubmit function works in Firefox & Chrome but not IE7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JC Harris
    New Member
    • Jul 2010
    • 2

    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

    Code:
     <form name="myform" onsubmit="return validate(this)" method="post">
    
     E-Mail: <input type="text" name="email" size="40" />
     Password: <input type="password" name="password" size="12" />
    
     <input type="submit" value="submit" id="my_submit"  /></p>
    
    </form>
    
    
    
    function validate(form)
    {
      var email = form.email.value;
      var password = form.password.value;
      var errors = [];
    
      if (!checkLength(email)) {
       errors[errors.length] = "You must enter an e-mail address.";
      }
    
      if (!checkLength(password)) {
       errors[errors.length] = "You must enter a password.";
      }
    
      if (errors.length > 0) {
       reportErrors(errors);
       return false;
      }
    
      form.action ="dl4.php?f=downloads/5061h.zip&e=" + email + "&p=" + password;
    
      return true;
    }
    Last edited by Dormilich; Jul 29 '10, 06:48 PM. Reason: Please use [code] tags when posting code
  • Logic Ali
    New Member
    • Jul 2010
    • 16

    #2
    Originally posted by JC Harris
    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?
    If checkLength() and reportErrors() are present, there should be no error. Otherwise you must show a live example.

    Comment

    • JC Harris
      New Member
      • Jul 2010
      • 2

      #3
      Originally posted by Logic Ali
      If checkLength() and reportErrors() are present, there should be no error. Otherwise you must show a live example.


      Any ideas?

      TIA,

      ---JC

      Comment

      Working...