Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to navigate with onclick event

Status
Not open for further replies.

CassidyHunt

IS-IT--Management
Jan 7, 2004
688
0
0
US
I have a button that when clicked navigate to another page. I am doing something wrong and figured it would be and easy question.

I have tried the following:

Code:
javascript:document.location=default.asp?page=2
javascript:window.location=default.asp?page=2
javascript:document.location.href=default.asp?page=2
javascript:window.location.href=default.asp?page=2

button code
Code:
<input type='button' value='Click Me' onclick="javascript:document.location=default.asp?page=2">

Thanks

Cassidy
 
Figured it out

Code:
 <input type='button' value='Click Me' onclick="javascript:window.location='default.asp?page=2'">

Thanks
 
Try providing a full link to the page

Code:
<input type='button' value='Click Me' onclick="javascript:window.location=[COLOR=red]'[URL unfurl="true"]http://www.PAGELINK.com/default.asp?page=2'[/URL][/color]">


---------------------------------------
Thanks for your help,
Jon

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top