michael said:
yeah, simple AND informative, not a good combination for me.
at least my misspellings were consistent, eh? well, at least until I
called the variable to rename it...
for the sake of this exercise, I'm simply opening another window, but
the popup was the original intent.
If your script doesn't open the new window (AKA a popup), it can't
access it at all.
permission to email my test files ( four in all )?
No, but there's no harm in posting up to say 100 lines of code that
display the issue. Often in developing a test case for posting you'll
discover a solution. If not, you have likely learned something anyway.
uhm, yeah, back to your opening remark,
When an intrinsic event is fired you can get a reference to the element
that fired it using 'this', e.g.:
<input type="button" name="button-01" onclick="showName(this);">
<script type="text/javascript">
function showName(el)
{
// If the element has a name, show it
if (el.name) alert('The name is ' + el.name);
// If the element is in a form, say so
if (el.form) {
alert('I\'m in a form');
} else {
alert('Hangin\'...');
}
}
</script>
Every element that is a form control has a 'form' property that is a
reference to the form the element is in. So once you have a reference
to the element with 'this' it is trivial to get a reference to the form.
Alternatively you could climb the DOM tree of the element's ancestors
until you get to a form element but it's not required (though that
strategy can be employed in other situations like getting a reference to
the table that a cell is in).
If an event is fired by a form's onsubmit handler:
<form name="formA" onsubmit="return doStuff(this);" ... >
Then doStuff can get a reference to the form:
function doStuff(theForm)
{
// theForm is a reference to formA
}
one of my objectives is to have the page(s) automatically move the
end-user through the pages after making their selections and or text
inputs. a tad more complication to the mix ( or what I like to call
confused state of uhm-dom ).
I take it that you hope to open windows to let the user make selections
that are then put into the form.
As a general strategy, that is fine but remember that not everyone has
JavaScript enabled so successful completion of the form should not be
dependent on JavaScript. The non-scripted version need not be pretty as
long as it is functional.
If this is for an intranet, then maybe you can ignore that advice.