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
• Re: Help Running VB script in Windows 2003
• ONUNLOAD
• Re: Insert Contents of .txt file into a .html page
• Re: Perl regular expression problem.
• Re: Problems in login using WWW::Mechanize
• searching for gd::graph guide
• Re: ARRAY OF HASHMAPS
• Adv. Regexp or Otherwise
• Adv. Regexp or Otherwise


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