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! || Forums || 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='http://www.codetoad.com/dhtml'">


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










Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


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-2009