Welcome to WebmasterWorld Guest from 54.211.17.91

Forum Moderators: incrediBILL

Message Too Old, No Replies

Page display locked by HTML code for form

   
9:36 am on Nov 18, 2012 (gmt 0)



I have a peculiar problem that I have verified in IE and Firefox and can not find a solution on WebmasterWorld.

I have a custon perl script that uses a HTML text box and submit button ("a form") on the left side of my home page where the basic navigation menu for the page/site is located.

When the page loads, its bottom edge is locked by the text box to the bottom of my screen; the result is that the top of the page (what I call the masthead) is cut in half.

Inside the text box, the cursor is blinking indicating that some input is being requested.

In order to see the entire masthead, I need to use my mouse on the right scroll bar to move the page upward.

I have a hyperlink at the bottom of the home page called "Top of Page". When I click on the link the page redisplays with the bottom of the text box again anchoring the base of the webpage, replicating the cutoff of the masthead.

The HTML code validates on W3.

I can eliminate the problem by moving my search box code higher in the left hand menu pane, but I do not like the look of the menu with this change.

The home page is an old design using tables with some updates using CSS (CSS validates).
12:02 am on Nov 21, 2012 (gmt 0)



I have discovered a solution to my problem.

Summarizing, the text input box was locking the display of the web page at the point where the text box was located. The consequence was that the page's masthead was not rendering in full.

The text box is for the input of query terms to a search program that is triggered by clicking a submit button. This action causes some Javascript to run the program.

It was the Javascript causing the problem:

<script type="text/javascript">
document.SearchForm.Terms.focus();
</script>

The problem code was .focus() in the Javascript.

I deleted .focus() and replaced it with:

.triggerHandler("focus")

The web page now loads normally with the masthead fully visible and justified to the top of the screen.

I checked the rendering in IE and Firefox. The code also validates.
1:59 pm on Nov 21, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks for posting your discovery. It does sound pretty strange to me, however the folks in our JavaScript Forum [webmasterworld.com] might have more insight.
8:24 pm on Nov 21, 2012 (gmt 0)



Thanks, Ted. I am rather curious as to the history/source of the code.