Terry A. Haimann wrote on 19 Nov 2003:
I have the following function that works under netscape 7, but
doesn't work under ie. What changes should be made to make it
run under ie?
function ButFunction()
{
var Page;
var s;
var d;
var h, w;
s = document.SrchForm.SearchDB.value;
d = document.SrchForm.DetailDB.value;
d = d - 1;
What exactly are you trying to do here? The Select.options array
expects an numerical index, so unless the value of each option in the
select menu is its own index, your code below shouldn't work. If the
option values do contain their index, you've picked an awkward way of
doing things. This would probably be better:
var s = document.forms['SrchForm'].SearchDB.selectedIndex;
var d = document.forms['SrchForm'].DetailDB.selectedIndex--;
There's also no need for the separate decrement, and the values could
be a little more meaningful (if appropriate).
Note: Select.selectedIndex will return zero-based indexes, so using
the above means that the first option in the DetailDB menu cannot be
selected. In that case, 'd' would be -1 and that's out of range for
the Select.options array.
Page = "Table_Page.html?" + "sch=" +
document.SrchForm.SearchDB.options[s].text + "&" +
"dtl=" + document.SrchForm.DetailDB.options[d].text;
var newWindow = open(Page, "Records Selected", "fullscreen=yes");
'fullscreen' is not a valid feature for a window (not by my
references, anyway), and it has been said in this group many times
now that trying to manipulate the user's browser dimensions is a bad
idea.
'Records Selected' is invalid. Remove the space or replace it with an
underscore. A window name is the same as a frame name and must begin
with a letter, and only contain letters, digits, hyphens (-),
underscores (_), periods (.), and colons (:). However, if you refer
to a name that contains anything other than alphanumeric characters,
you should use the appropriate collection and "quote" the name (like
I did earlier, using document.forms).
You should also use window.open(...) to make the call to
window.open() less ambiguous, and to avoid accidentally calling
document.open().
Hope that helps,
Mike
--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)