whitedark554 Posted May 25, 2006 Share Posted May 25, 2006 I'm trying to use an input button as a link but it isn't working to well...When I click the button, the link doesn't open.I'm using this code: <a href="main.html"><input type="button" value="Enter"></a> Is there anyway I can make that button a link? Link to comment Share on other sites More sharing options...
pulpfiction Posted May 25, 2006 Share Posted May 25, 2006 Try this.<input type=button value="submit" onclick="java script:window.location.href='http://www.google.com';" /> Link to comment Share on other sites More sharing options...
Mihalism.com Posted May 26, 2006 Share Posted May 26, 2006 Post deleted by poster. Link to comment Share on other sites More sharing options...
snowboard01 Posted May 26, 2006 Share Posted May 26, 2006 U used to think that but have you tested it? buttons aren't at all affected by the a tag. You must use javasvript Link to comment Share on other sites More sharing options...
TBolt Posted July 4, 2006 Share Posted July 4, 2006 U used to think that but have you tested it? buttons aren't at all affected by the a tag. You must use javasvript<{POST_SNAPBACK}> Hi, guys. :)When I tested pulpfiction's button, (http://w3schools.invisionzone.com/index.php?showtopic=4987&hl=buttons), my web browser blocked the action until I allowed it. I'm just wondering if there is ANY other way to link a button to a web page w/out concerning the web site visitor about blocked actions.[edit]Nevermind...the web browser had to be set simply because I recently reformatted my system. Thank you for this helpful forum.TBolt Link to comment Share on other sites More sharing options...
TBolt Posted July 5, 2006 Share Posted July 5, 2006 Okay, quick question...how do we change this code so that the link opens up in a new browser?<input type=button value="submit" onclick="java script:window.location.href='http://www.google.com';" />Thank you much! Link to comment Share on other sites More sharing options...
zanfranceschi Posted July 5, 2006 Share Posted July 5, 2006 onclick="window.open('http://www.google.com');" Link to comment Share on other sites More sharing options...
TBolt Posted July 5, 2006 Share Posted July 5, 2006 onclick="window.open('http://www.google.com');"<{POST_SNAPBACK}> Wonderful! Thank you, zanfranceschi. :)Where'd you learn that? hehe Link to comment Share on other sites More sharing options...
zanfranceschi Posted July 5, 2006 Share Posted July 5, 2006 Years and years of experience!!hehe.. just kidding... http://www.irt.org/script/script.htm if a good resource I use often. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now