![]() |
Complete Web Development and Hosting Using |
| Portfolio Testimonials Tel: 602-644-1PHP | Fax: 480-704-4559 July 29, 2010 | |
|
Solution to long, hidden divs opening at the bottom of the page in Firefox...by Richard Whitney
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"> </a> And that's it! I hope this helps someone save hours of frustration. Happy coding! |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||