By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

Multiple Frame Targets

P: n/a
Howdy:

Let's suppose for illustration that I have a web page with 3 frames:
Let's call them 'fStates', 'fCounties', and 'fCities'.

On loading the page, fStates has a select list of states and the other
two are empty. The form "target" attribute is 'fCounties', and
an event handler for the list in 'fStates' looks something like this:
onChange="form.submit();"

So when we click on a state item in 'fStates', a CGI action is posted to
'fCounties' and displays a list of counties there and now we 'target'
'fCities' to display cities for the chosen state->county venue, using
a similar approach.

It follows that when we click on a city, a new page is rendered, but
let's suppose that the user clicks again on a state, which then renders
the list of counties for that state *but* the 'fCities' frame now holds
a list of cities for the previously chosen state->county venue.

This could lead to confusion.

Question: Is there a way to clear 'fCities' from the onChange event in
'fStates' at or previous to the rendering of 'fCounties'? Pointers to
documentation, URLs, and examples are welcome.

TIA
Tim
Aug 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ASM
Tim Johnson wrote:
Howdy:

Let's suppose for illustration that I have a web page with 3 frames:
Let's call them 'fStates', 'fCounties', and 'fCities'.

On loading the page, fStates has a select list of states and the other
two are empty. The form "target" attribute is 'fCounties', and
an event handler for the list in 'fStates' looks something like this:
onChange="form.submit();"


It's much beter to use the input submit
(and if fellow did mistake ? too late ! that's fired)

for your confusion,
you could try something as following :
submit button is disabled
list onchange enable submit button
and
the submitting re disable submit button

<form action="engine.ph" target="fCountries"
<!-- "fCities" depends of frame -->
onsubmit="document.forms[0][1].disabled=true;">
Choice a country (state, city ... depends of frame)
<select onchange="document.forms[0][1].disabled=false;">
<option ...
</select>
<input type=submit name="submitBut" disabled value="GO">
</form>

or beter
in states frame the submitting disable its own submit button
then
in cities, loaded page re enables states's submit button :

- states frame page =
<form action="engine.php" target="fCountries"
onsubmit="document.forms[0][1].disabled=true;">
Choice a country (state, city ... depends of frame)
<select>
<option ...
</select>
<input type=submit name="submitBut" value="GO">
</form>

- and cities form page =
<body onload="parent.fStates.document.forms[0][1].disabled=false;">
--
Stephane Moriaux et son [moins] vieux Mac
Aug 19 '05 #2

P: n/a
Hi Tim,

Here are two ideas for your wanting to clear two frames upon one
button click using javascript.
Idea 1. Set the target of the form to the last (cities) frame and put
a blank (the default) page for the action if you get a different 2nd
frame (county). Right before submitting, do a window.setTimeout
(unclear if that is setTimout is necessary) which in turn will change
the action and target of the form back to the original 2nd frame.
Again, try it without the setTimeout because you may not need it.

Idea 2. If you navigate to a different 2nd frame (presuming you are
keeping track somehow), in the onload of that frame, have the frame
self submit a blank page to (with a target of) the 3rd frame.

Good luck,
Csaba Gabor from Vienna

Tim Johnson wrote:
Howdy:

Let's suppose for illustration that I have a web page with 3 frames:
Let's call them 'fStates', 'fCounties', and 'fCities'.

On loading the page, fStates has a select list of states and the other
two are empty. The form "target" attribute is 'fCounties', and
an event handler for the list in 'fStates' looks something like this:
onChange="form.submit();"

So when we click on a state item in 'fStates', a CGI action is posted to
'fCounties' and displays a list of counties there and now we 'target'
'fCities' to display cities for the chosen state->county venue, using
a similar approach.

It follows that when we click on a city, a new page is rendered, but
let's suppose that the user clicks again on a state, which then renders
the list of counties for that state *but* the 'fCities' frame now holds
a list of cities for the previously chosen state->county venue.

This could lead to confusion.

Question: Is there a way to clear 'fCities' from the onChange event in
'fStates' at or previous to the rendering of 'fCounties'? Pointers to
documentation, URLs, and examples are welcome.

TIA
Tim


Aug 20 '05 #3

P: n/a
ASM wrote:
Let's suppose for illustration that I have a web page with 3 frames:
Let's call them 'fStates', 'fCounties', and 'fCities'.

On loading the page, fStates has a select list of states and the other
two are empty. The form "target" attribute is 'fCounties', and
an event handler for the list in 'fStates' looks something like this:
onChange="form.submit();"

It's much beter to use the input submit
(and if fellow did mistake ? too late ! that's fired)

for your confusion,
you could try something as following :
submit button is disabled
list onchange enable submit button
and
the submitting re disable submit button

- and cities form page =
<body onload="parent.fStates.document.forms[0][1].disabled=false;">


Hi ASM: I did a little googling in the meantime and came up with the
following example at
http://www.sbrady.com/hotsource/java...twoframes.html
I'm wondering if something like top.fCities.location="empty.html";
would work in the fStates event handler. Then anytime one clicked
on the 'fStates' frame, the 'fCities' frame would be updated with
a page without the list on it.

I appreciate the ideas. This is worth some research because I don't
charge my client for research time, but I do charge them if I'm coding
(dead end or not).

Thanks
tim (<grin> who used to be an *ASM* programmer)

Aug 20 '05 #4

P: n/a
ASM
Tim Johnson wrote:
ASM wrote:
for your confusion,
you could try something as following :
submit button is disabled
list onchange enable submit button
and
the submitting re disable submit button

- and cities form page =
<body onload="parent.fStates.document.forms[0][1].disabled=false;">

Hi ASM: I did a little googling in the meantime and came up with the
following example at
http://www.sbrady.com/hotsource/java...twoframes.html


Oh yes, I know to launch to dble frames
but would that resolve your problem ?

that is : not click a 2nd time since cities's page not yet loaded
(did I understand)
I'm wondering if something like top.fCities.location="empty.html";
would work in the fStates event handler. Then anytime one clicked
on the 'fStates' frame, the 'fCities' frame would be updated with
a page without the list on it.
thought you had to refresh cities-form-list from states's choice ?
not understand use of non listed cities ...
Thanks
tim (<grin> who used to be an *ASM* programmer)


ASM = Amazing Stephane Moriaux :-)
--
Stephane Moriaux et son [moins] vieux Mac
Aug 20 '05 #5

P: n/a
My thanks for all the good input. The bottom line appears
to be that this is doable. So I shall proceed.
Thanks again
tim
Aug 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.