free hosting   image hosting   hosting reseller   online album   e-shop   famous people 
Free Website Templates
Free Installer

Using A Button As A Link



Both submit and the standard button can be used as links.

These are inserted as desired in the body section of your page.

First, the Submit button:

The label for the button is placed inside the value parameter -- in this case, "Press Me".

When the button is clicked, an HTML page called somepage.html will be retrieved, and loaded into the same window (or frame).

To open the page in a new window, do this:
Incidentally, this only works with http protocol -- it will not work with ftp links such as ftp://server.com/sompage.html.

Now, the Standard button:


Very similar to the Submit button, but uses the OnClick command to call the function loadURL:
This simply opens a new window whose contents are the URL of the page.

Note that since no parameters are given for the new window, a standard window will open.

Exactly the same as if you used target="_blank" in a standard hyperlink.


To open the new page in the same window (or frame), use the following code:
NOTE:

if you're using more than one button on the same page, to avoid any confusion, make sure you give each button its own unique label.
eg.: button1, button2, etc.

Try It Out


Submit Button


Standard Button


© 2001 CyberSchool
Last Update: