View Full Version : what is the script to create a button and...
07-16-2005, 12:48 AM
I am trying to create a button (onClick) that will get to a specified page. Can anyone help?
<button onclick="window.location.href='newpage.htm';">Go to newpage.htm</button>
If you're willing to take a little time over it, you'll be better off using a link with a outset border-style and a grey background to make it LOOK like a button, thus making it work in non-JS browsers.
<a href="newpage.htm" style="text-decoration: none; border-style: outset; background-color: grey; border-color: grey; border-width: 3px; color: black;" onclick="this.style.borderStyle='inset';">Go to newpage.htm</a>
Or, you can use a form with no inputs:
<form action="newpage.htm" method="post">
<input type="submit" value="Go to newpage.htm"/>
Tweak as required.
07-16-2005, 03:22 PM
say if I would like to allow guests to enter/select on which state they're in in a text field, then (as they click on a button) I would like the site to direct accordingly.... what would be the steps for this type of action....???
<!-- ... and so on ... -->
If Alabama were selected, the user would be sent to alabama.htm; if Michigan were selected, the user would be sent to michigan.htm, and so on.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.