How to create onclick confirmations for hyperlinks hyperlink confirmation box java script, hyperlink onclick confirmation
Many links have roles to to create or delete or deactivate a database record, to redirect the visitor to another page and you need to worn those who click these links about possible consequences and give them a reminder of what they are about to do (Confirmation box for that link).
How to create a simple confirmation box for a HTML Hyperlink
HTML Hyperlink without confirmation syntax:
<a href="http://www.new-location.ro" title="Hyperlink title" class="some class">Go to new location</a>
HTML Hyperlink with confirmation syntax:
<a href="http://www.new-location.ro" title="Hyperlink title" class="some class" onClick="return confirm('You are about to go to New Location website')">Go to new location</a>
Basically, we just add onClick="return confirm('You are about to go to New Location website')" property to the hyperlink and when it'll be clicked it will display the text "You are about to go to New Location website" giving the visitor the change to press OK(go forward) or Cancel.
Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.