Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2004, 07:30 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default Popup Menu Help No. 2

Hi Everyone,

I recently asked about the select boxes overriding the popup menu.

I have run into another problem.

I have the popup menu code in a external file. I use it for many pages, how ever only a couple of pages use the select boxes and need to write a if statement in my showMenu function to only apply the hiding of the select box if on the perticular page. Because the popup menu will fall over unless its a valid field to hide.

eg.

Code:
function FW_showMenu(menu, x, y, child) {

    document.forms.form2.projects.style.display='none';

Normal popup code****
How do you write a If statement in javascript that if the page is MainProjects.asp put code
Code:
document.forms.form2.projects.style.display='none';
else skip it.

Thanks in advance

Tim

TDA
__________________
TDA
 
Old July 7th, 2004, 07:34 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Something like this?

if(window.location.indexOf("MainProjects.asp") > -1)
{
   document.forms.form2.projects.style.display='none' ;
}

BTW don't forget to un-hide the <select> when the menu closes! :-)

HTH,

Snib

<><
 
Old July 8th, 2004, 07:11 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Thanks heaps,

all works perfectly

Tim:D

TDA





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hide combo box behind the popup menu? mohini ASP.NET 1.x and 2.0 Application Design 4 March 22nd, 2006 12:22 AM
Popup Menu rweide Javascript 5 June 24th, 2005 03:28 PM
Cascading popup menu rodmcleay VB How-To 0 March 3rd, 2004 10:47 PM
Access' file popup menu Exodus Access VBA 2 December 29th, 2003 09:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.