471,083 Members | 1,212 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,083 software developers and data experts.

Help Please - how do I load a new HTM page using onClick

DK
I am very new to JS and trying to use a button to move on to a new html page
rather than a text link.

The code I have is as follows; (having tried to wrap the button in a HREF)

<A HREF="index.htm">

<input type='button'
id='Button2'
name='Button2'
style='width:146px;height:46px;border:1px#000000

solid;background-color:#FFFF99;color:#000033;font-family:Verdana;font-size:1
0pt;'
value='INDEX'
onClick='return true;'


</input>
</A>

This does not work not sure why, I originally tried calling a js function
jsLoad() to load a new page but don't quite know how to do this?

<SCRIPT LANGUAGE=javascript>
<!--
function jsLoad()
{

don't know what to put here !!!!!

}
//-->
</SCRIPT>

Any help on this would be much appreciated.

Regards

David
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003
Jul 20 '05 #1
2 17046

"DK" <asas07(AT)dsl.pipex.com> schreef in bericht
news:3f*********************@news.dial.pipex.com.. .
I am very new to JS and trying to use a button to move on to a new html page rather than a text link.


<input type="button" onclick="location='index.htm'" value="INDEX" />
JW

Jul 20 '05 #2
"DK" <asas07(AT)dsl.pipex.com> wrote:
I am very new to JS and trying to use a button to move on to a new html
page rather than a text link.
I really hope that this is a learning exercise. Using JS to simulate things
that can be done in HTML is not a good idea.
The code I have is as follows; (having tried to wrap the button in a
HREF)
So is the objective to use a button as a link? Don't, use a link as a link
and then style it to look how you want.

http://tom.me.uk/2002/8/css-buttons.html
This does not work not sure why, I originally tried calling a js function
jsLoad() to load a new page but don't quite know how to do this?

<SCRIPT LANGUAGE=javascript>
<!--
function jsLoad()
{

don't know what to put here !!!!!


Set document.location to the URI you want.

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by . . | last post: by
4 posts views Thread by Chris | last post: by
5 posts views Thread by Chris | last post: by
1 post views Thread by donradii | last post: by
5 posts views Thread by althafexcel | last post: by
7 posts views Thread by gubbachchi | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.