Conflict between onLoad code and javascript

I have a contact form with a submit button which is disabled by default. This is done to interfere with spambots which have abused the form. The button is enabled by javascript. This contact page is intended for mobile visitors, and it is loaded in a frameset. In order to assure that the contact form loads at the top of the page, and not at the level of a link embedded in the page from which it is loaded, there is onLoad code in the contact form. The onLoad code forces the contact form to scroll to the top when the page is loaded. However, there is a dilemma. The javascript which enables the submit button somehow interferes with the onLoad code, such that the page does not scroll to the top when loaded. However, without that javascript, the submit button is disabled. I'm looking for a method of enabling the submit button without conflicting with the onLoad code. I've simplified the contact form, rendering only the essential elements of it in the snippet. The actual contact form is at www.mauitradewinds.com/RezEasy/mobile/rez_m-contact.html

A spambot doesn't need a submit button at all to submit a form so disabling it is pointless. Plus, you are disabling and re-enabling on the same page in the onLoad event.

There are a few other methods that work better (though not perfectly). I assume you don't want to use a CAPTCHA method.

1.) Insert a text box and label set to visibility:hidden and leave it blank. Label it something normal like First Name. Test that that field is blank in validation. Spambots tend to fill in every field to get past the validators.

2.) Use javascript to capture and cancel any submitting of the form before a predetermined number of seconds has passed, say 15 seconds. Humans take much longer to fill out forms than spambots. If it's filled out too quickly, it's a spambot.

3.) Require the user to delete text from a field before clicking submit. "Delete this text before submitting the form." Check that that field is blank in validation. Again, spambots tend to fill in every field.

Thank you both for your comments. Tom: I do have an invisible text field, which is checked in validation. The PHP exits if that field is not blank. The text field is named "how", and it is preceded with the question: "How did you learn about Maui Tradewinds?"

In a previous question about captcha methods, an Expert suggested that I use an auxiliary method, namely, disabling the submit button unless the visitor uses javascript, because most bots don't use javascript. Now, understanding that bots usually don't load a form in a browser, I'm not so interested in disabling the Submit button.

I very much like your suggestion about canceling a form which is submitted before a predetermined number of seconds. Are you able to supply code for that? If I should start a new question about this, let me know. Here is the present PHP code...

Featured Post

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Today I would like to talk about localizing (Internationalization) JavaScript applications.
Introduction
When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…

The viewer will learn the basics of jQuery, including how to invoke it on a web page.
Reference your jQuery libraries: (CODE)
Include your new external js/jQuery file: (CODE)
Write your first lines of code to setup your site for jQuery.: (CODE)

The viewer will learn the basics of jQuery including how to code hide show and toggles.
Reference your jQuery libraries:
(CODE)
Include your new external js/jQuery file:
(CODE)
Write your first lines of code to setup your site for jQuery…