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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Button tag

Status
Not open for further replies.

moepower

Programmer
Oct 5, 2000
93
US
I need to create a button that when clicked will redirect the user to a certain URL address. How do I go about include the URL in the <button> tag? Thanks,
 
you need to put onClick=&quot;redirect()&quot; where redirect is the function that sends people to a different page -Greg :-Q
 
Code:
<html><head></head><body><form>
<input
Code:
onClick=&quot;parent.location.href='[URL unfurl="true"]http://www.yahoo.com';&quot;[/URL]
Code:
 type=&quot;button&quot; value=&quot;Go to Yahoo!&quot;>
</form></body></html>

This will do it. All you have to do is plug in the URL (instead of to this onClick=&quot;parent.location.href='
 
sorry i was figuring that b/c it was a button you were redirecting based on what was entered in the form -Greg :-Q
 
top.location works too, I was just thinking about if the page was loaded in frames... not sure y though :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top