But now over to the code. The advantage of the method used is that the form
can easily be extended without having to change much - just one checkbox for
each site to be opened in a new window. Apart from the obligatory "Open"
submit) and the "Default" button (
for resetting the form to defaults, I added a "Clear" button (
deselecting all checkboxes in one go.
The actual script consists of two functions: The first serves to opening the windows and the second to deselecting all checkboxes. The script is independent from the number of checkboxes in the form.
open() used here I have to mention
that its second parameter specifies the name of the window, i.e. using this
name which consists of "win" and the internal number of the respective
form checkbox (that means for example "win1" for the sixth checkbox)
you can access this window; for that pupose the window name has to be determined
as a value for
target as in links of the form
<HEAD> section you have to embed the following script:
The individual form elements can be placed, for example, in a table. (CSS-) layers on the other hand seem really to trouble Netscape Communicator, thus you should rather do without using them for positioning of the form (other elements of the page are not affected by that).
Instead of the checkboxes in the following code you can now insert as many
own checkboxes as you want. The only thing that matters is the
determining the URL (in order to be able to use any address, "http://"
is not being added!); practically you should put a description
of some value of recognition before or behind each checkbox. If the respective
checkbox shall be selected by default the "
has to be added to the respective checkbox tag (like in the first case of the
A final annotation: The connection between the form and the script is established
using the form name. It would also be possible to work without the name by refering
to the form in the script using its internal number (if it's the only one in
the page it follows:
<BODY> section you can embed the following code at
almost any position:
<form name="openlist" target="_self"> <input type="checkbox" value="http://www.slashdot.de/" checked> Slashdot <input type="checkbox" value="http://www.the-ctrl-alt-del.com/"> The Ctrl-Alt-Del <input type="submit" value="Open!" onClick="formeval()"> <input type="reset" value="Default"> <input type="button" value="Clear" onClick="clearform()"> </form>
If there should be any further questions or uncertainties I am willing to find a solution. Write me a mail!
February 3, 2001