onchange not sufficient to handle changes in a frame

B

Beemer Biker

I am using a pull down box and firing the onchange event to put some stuff
in a frame "main". However, other objects can also update the same frame.
I would like to be able to restore the image in the frame by re-selecting
the item in the pull down list. This works fine as long as the item I
select is not the on currently selected (but not necessarily shown)

If I reselect the same item in the pull down list, as expected the "main"
frame will not get restored since truely there is "no change"

I tried adding "onkeyup" to the pulldown box. OK, presssing return on the
same item will cause it to get redrawn and that causes the "main" frame to
get re-selected. But who would know to press return. I could add a reset
button, but it seems to be there should be some way to force a reselect. I
looked at the methods associated with the pull down list and dont see
anything obvious.


Is there some type of "on frame change" that I can use to invalidate the
pull down box? ie: set the selectedIndex of the pull down box to '0' which
then shows a "please select".


--
=======================================================================
Beemer Biker joestateson at grandecom dot net
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================
 
S

Steve Easton

For starters you need to use onclick and a Go button instead of an onchange event.
"Because"..... if you use onchange, people who navigate using the keyboard instead of the mouse will never get past the
first item in the list.

Try it, tab over to the dropdown and click the down arrow. Bingo the onchange is fired.



--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
B

Beemer Biker

Steve Easton said:
For starters you need to use onclick and a Go button instead of an
onchange event.
"Because"..... if you use onchange, people who navigate using the
keyboard instead of the mouse will never get past the
first item in the list.

Try it, tab over to the dropdown and click the down arrow. Bingo the
onchange is fired.

Thanks Steve ..but..

The dropdown list box handles the keyboard automatically. I can hit tab
from the main window
http://ResearchRiders.org
and then continue hitting tab until my dropdown box "select division" is
highlighted. Then any of the up/down cursor keys work: ie: up, down
immediately selects an item. There is no need to click on anything.

The same problem: If "Divison 16" is left selected but the user clicks on
a hyperlink elsewhere in the page using the mouse (say one of the highlited
event days), then the frame holding the information switches to the new html
but the "Division 16" box still show "Division 16". At a minimum I would
like that dropdown box to be invalidated and be set back to "Select
Divison". I just need to come up with a clean way to invalidate the
dropdown box ie: reset it to "select division" whenever the context of the
frame changes from "division information" to something else. Maybe this is
a better way to do this.
 
S

Steve Easton

Ok, I "think" you missed my point.
Yes you're correct in that up down immediately selects the item,
But what if there are 10 items in the drop down and the desired item is in the middle of the selection??
as the user arrows down, each selection will display because the onchange is fired each time the arrow is pressed.

Using an onclick and a Go button lets the user arrow down to where they want and then tab to the go button and press
Enter
to fire the selection.

Try this in a blank page:

<form>
<p align="center"><b>Select a site </b>
<select id="Choice" style="color: #0000FF" size="1" name="mySelect">
<option value="">Select one</option>
<option value="http://altavista.com">AltaVista</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.google.com">Google</option>
</select>
<input type="button" value="Go" onclick="window.open(Choice.options[Choice.selectedIndex].value)">
</p>
</form>


With some tinkering, you should be able to make this reset other drop downs on the page to the "Select Division" state.

It would require creating a function for the onclick to fire, with
"window.open(Choice.options[Choice.selectedIndex].value)"

--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top