Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 904139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:00:05+00:00 2026-05-15T16:00:05+00:00

I was creating a form validator for a client and ran into this weird

  • 0

I was creating a form validator for a client and ran into this weird error only in Internet Explorer (Explorer) 7/8….

‘return’ outside of function, line 1, char 1

Of course, there was no code whatsoever on line 1. It was a simple commented statement. And there was nothing wring with it in any way. So I knew it was just a debug misdirection.

I have been pulling my hair out to understand what could be wrong here…

I have already ruled out the obvious: return statements in a loop, too many return statements in a single function, and any returns actually outside of a legitimate function definition.

What is the reason for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:00:06+00:00Added an answer on May 15, 2026 at 4:00 pm

    The problem was that I was using a return statement to override the default behavior for my form and it was assigned to a property, but it was not placed inside an anonymous function!

    I had a form element that was set up like this:

    <form name="formname" onSubmit="javascript:validateForm(this);" action="javascript:return false;" method="post" enctype="multipart/form-data">
    

    All I needed to change was the action property to this:

    … action="javascript:function(){return false};"
    

    It now works flawlessly!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating a form validation script based on the jQuery validator plugin .
I was creating a form like this : if select b, the textbox is
I am creating a form using Cake.In the form there is a $this->Form->button($i); element.
I am using jQuery to create a client-side validation function for a .NET form.
I'm fairly new at creating custom unobtrusive validation, and am running into a weird
I'm creating a registration form for a client for an event they're hosting. The
When I was programming a Form Validator in PHP, when creating new methods, I
I am creating a Zend form. when i have submit the form then error
I'm quite anal about form validation. So while creating a validator for a data
I'm creating registration page and I've done basic client side (JS) form validation. Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.