homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Page display locked by HTML code for form
slipkid




msg:4520051
 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).

 

slipkid




msg:4520923
 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.

tedster




msg:4521093
 1:59 pm on Nov 21, 2012 (gmt 0)

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.

slipkid




msg:4521242
 8:24 pm on Nov 21, 2012 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved