Erratic run time error with drop down menu behavior

D

David Kirk

I built a drop down menu using behaviors. It is quirky,
to say the least. For example, even though there is a
check-off option to disbale the first menu choice, the
first menu choice is disabled by default and no amount of
trickery will make it do otherwise. (Workaround: name
the first item "Click Here for Options" or something to
that effect.)

The bigger issue I'm having is this: I developed the drop
down menu in a blank new page. If I preview that page in
FRP or preview in Browser, it works perfectly. However,
no matter how I get that menu onto another page on my
live site -- pasted into a spot on another page, as an
include page, as part of an include page or even inserted
directly onto a given page, I always get a "Runtime
Error: Object Expected" when I try to use the menu on any
page on my live site, using IE6 on Windows XP. For some
reason, the only way I have been able to get the menu to
work is as the only item on a separate page at
http://www.theprguy.com/QuickMenu.htm. I link to this
from the footer that is included on al pages in my site
but this is hardly ideal. Any helpers out there?
 
S

Steve Easton

The problem with using it in an include is
that the javascript that creates to execute the
"linking function" is placed between the <head></head> tags.
Include pages only "include" data that is between the
<body></body> tags, therefore the script is "left behind"
and the runtime error occurs.

I'm assuming that this is also the problem when you copy and paste.
Make sure you also copy and paste the script into the "other" page.

Additionally, if you want to use an include to do this, move
the javascript from the head tags to between the body tags in
the include. It will still work.

hth
 
D

David Kirk

Gosh, Steve, I really appreciate the prompt response!
But I'm afraid I'm not technically adept enough to know
how to use the information. If I am putting the drop
down on an include page (which I am), where exactly do I
need to move the drop down code? I asume that in design
mode I would select the dropdown box then switch to the
code mode to see the selected text. I would then cut that
text and place it ... where?

Sorry to be dense but I'm a WYSIWYG guy not a coder.
Many thanks!!
 
S

Steve Easton

For an include page leave the drop down code exactly where it is.
However in html view, cut this:

<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>

from between the head tags and place it just under the
opening <body tag

Or, if you copy and paste the drop down form to another page,
make sure you also copy and paste the script as I posted above
( which I just copied from the page at the link you posted )
between the head tags of any page you use the drop down in.
The form code and the javascript must both be on each page.

hth
 
D

David Kirk

Thanks. I hope someone is paying you for your brilliance
and your generosity. I really appreciate the step-by-
step instructions for this html Dummy. I'll do this
later today and make a big improvement to my site. Many
thanks!
-----Original Message-----
For an include page leave the drop down code exactly where it is.
However in html view, cut this:

<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval (frm+".location='"+href+"'");
}
// -->
</script>

from between the head tags and place it just under the
opening <body tag

Or, if you copy and paste the drop down form to another page,
make sure you also copy and paste the script as I posted above
( which I just copied from the page at the link you posted )
between the head tags of any page you use the drop down in.
The form code and the javascript must both be on each page.

hth
--
95isalive
This site is best viewed..................
...............................with a computer

Gosh, Steve, I really appreciate the prompt response!
But I'm afraid I'm not technically adept enough to know
how to use the information. If I am putting the drop
down on an include page (which I am), where exactly do I
need to move the drop down code? I asume that in design
mode I would select the dropdown box then switch to the
code mode to see the selected text. I would then cut that
text and place it ... where?

Sorry to be dense but I'm a WYSIWYG guy not a coder.
Many thanks!!

copy
and paste. this,
move wrote
in message amount
of page
in on
any menu
to


.
 
S

Steve Easton

Thanks,
But the only thing brilliant here is the light
reflecting off of the top of my head.

--
95isalive
This site is best viewed..................
...............................with a computer

David Kirk said:
Thanks. I hope someone is paying you for your brilliance
and your generosity. I really appreciate the step-by-
step instructions for this html Dummy. I'll do this
later today and make a big improvement to my site. Many
thanks!
-----Original Message-----
For an include page leave the drop down code exactly where it is.
However in html view, cut this:

<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval (frm+".location='"+href+"'");
}
// -->
</script>

from between the head tags and place it just under the
opening <body tag

Or, if you copy and paste the drop down form to another page,
make sure you also copy and paste the script as I posted above
( which I just copied from the page at the link you posted )
between the head tags of any page you use the drop down in.
The form code and the javascript must both be on each page.

hth
--
95isalive
This site is best viewed..................
...............................with a computer

Gosh, Steve, I really appreciate the prompt response!
But I'm afraid I'm not technically adept enough to know
how to use the information. If I am putting the drop
down on an include page (which I am), where exactly do I
need to move the drop down code? I asume that in design
mode I would select the dropdown box then switch to the
code mode to see the selected text. I would then cut that
text and place it ... where?

Sorry to be dense but I'm a WYSIWYG guy not a coder.
Many thanks!!


-----Original Message-----
The problem with using it in an include is
that the javascript that creates to execute the
"linking function" is placed between the <head></head>
tags.
Include pages only "include" data that is between the
<body></body> tags, therefore the script is "left behind"
and the runtime error occurs.

I'm assuming that this is also the problem when you copy
and paste.
Make sure you also copy and paste the script into
the "other" page.

Additionally, if you want to use an include to do this,
move
the javascript from the head tags to between the body
tags in
the include. It will still work.

hth

--
95isalive
This site is best viewed..................
...............................with a computer

in message
I built a drop down menu using behaviors. It is
quirky,
to say the least. For example, even though there is a
check-off option to disbale the first menu choice, the
first menu choice is disabled by default and no amount
of
trickery will make it do otherwise. (Workaround: name
the first item "Click Here for Options" or something to
that effect.)

The bigger issue I'm having is this: I developed the
drop
down menu in a blank new page. If I preview that page
in
FRP or preview in Browser, it works perfectly.
However,
no matter how I get that menu onto another page on my
live site -- pasted into a spot on another page, as an
include page, as part of an include page or even
inserted
directly onto a given page, I always get a "Runtime
Error: Object Expected" when I try to use the menu on
any
page on my live site, using IE6 on Windows XP. For some
reason, the only way I have been able to get the menu
to
work is as the only item on a separate page at
http://www.theprguy.com/QuickMenu.htm. I link to this
from the footer that is included on al pages in my site
but this is hardly ideal. Any helpers out there?


.


.
 
Top