codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || RAM 
Search Site:

Making a Link out of a Standard Button



You may have wondered how to make a standard browser button such as the 'Submit' button into a link. This would allow you to create a nice button with appropriate text, instead of a boring underlined link. This is the affect we want :

    

This is simple enough to do, using the onclick event to listen for the user pressing the button, and then the javascript location.href property to redirect us to the correct page. Here's the full code:



<input type=button value="Click here for DHTML code"
 onclick="javascript:location.href='/dhtml/index.html'">


As usual, keep all the above on one line to ensure it works properly.










Recent Forum Threads
•  Run a program both on windows and linux
•  VERO.SurfCAM.v2014
•  Schlumberger.Petrel.V2013.2
•  Petrel.V2013.2
•  Altair.HyperWorks.v12
•  VoluMill.v6.1
•  VoluMill.NEXION.6
•  VERO.SurfCAM.v2014
•  Schlumberger.Petrel.V2013.2


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2015