Command Buttons

M

Mark Gould

I am developing a web page and need to use 3 command
buttons to redirect the person who clicks on it to a
internet web site i.e. http://www.usatoday.com. I tried
various ways using the onClick method but haven't had much
luck. I am sure it is a simple thing to do but for the
life of me I can't see how. Has anyone done this before?
If so what did you do?

Thanks,

Mark
 
K

Kevin Spencer

Here's an example:

<input type="button" value="Read USA Today" name="B1"
onclick="document.location = http://www.usatoday.com">

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
M

Mark1110

Kevin,

I tried making a simple web page using your example:

<html>
<head>
<title></title>
</head>

<body>

<input name="B1" type="button" value="Click Me" onClick="document.location =
http://www.usatoday.com" >

</body>
</html>

When I brought up the web page and clicked on the button, nothing happened?
Am I doing something wrong?

Thanks,

Mark
 
K

Kevin Spencer

Sorry Mark. I left out some single quotes around the URL.

<input name="B1" type="button" value="Click Me" onClick="document.location =
'http://www.usatoday.com'" >

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
S

Steve Easton

Needs a minor modification. Try this:

<input type="button" value="Read USA Today" name="B1"
onclick="document.location='http://www.usatoday.com'">

Notice the single apostrophes. 'http://www.usatoday.com'


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top