phpMyDEV - Complete Web Development and Hosting using Linux Apache MySQL and PHP

Complete Web Development and Hosting Using
Linux, Apache, MySQL and Perl, Python, PHP
a LAMP environment

Portfolio      Testimonials      Tel: 602-288-5340 | Fax: 480-704-4559 | Toll-Free: 877-624-6302       March 10, 2010
Info
  Home
Portfolio
Hosting
Backups
Testimonials

Log
News
Privacy Policy
Contact Us
Order Capture

 
Pay with PayPal
 
Please describe what you are paying for. Please note: This is NOT for hosting payments.
Service or Product Description:

Amount: USD$
$




Appraisal Order Capture Payment $749.00

 

Solution to long, hidden divs opening at the bottom of the page in Firefox

...by Richard Whitney
I just ran into a problem where Firefox, or any Mozilla-based browser for that matter, opened up a hidden div (when show page 2 was clicked) that is longer than the browser window, at the bottom of the div. (As it turns out, IE does the same thing, but has a slightly different solution) I searched the internet for a solution and found none even close. I have figured out a way to open the div at the top without any user interaction or noticeability.

In my javascript functions file I check each form element in that div as it is completed and at the end of CheckPage1() I have:
document.getElementById('page1').style.display='none';
document.getElementById('page2').style.display='block';


which hides page 1 and presents page 2 (at the bottom of the div in Firefox).

The easy way to circumvent this problem is to add 2 lines of code at the bottom of yourCheckPageFunction():
document.getElementById('page2').focus(); (for Mozilla-based browsers)
document.getElementById('topPage2').focus();(for Internet Explorer)
return false;


In my form page, where I have <div id="page2" style="width:780px;display:none"> I add <a name="topPage2">&nbsp;</a> And that's it! I hope this helps someone save hours of frustration. Happy coding!
Contact Us
  Contact Us We are available most hours of each day. 877-624-6302
602-288-5340
Fax: 480-704-4559

phpMydEV@gmail.com
phpMyDEV
phpMyDEV
phpMyDEV
phpMyDEV
phpmydev

Call today for your Free no obligation quote.
 
Standards
 


Valid XHTML 1.0 Transitional

Valid CSS!

 
Google Ads
   

Testimonials | Website Backups | Support | Log | Portfolio | News | Privacy Policy | Links