Confirm Links
Confirm Links is a client-side JavaScript behavior for Dreamweaver that contains two separate behaviors:
- Confirm Link allows you to set a confirmation box on a specific link, with a user-defined message to display. This is useful on specific links that you want the end user to confirm before moving on, such as deleting a database record.
- Confirm All Links allows you to make all links on a given web page confirmable -- a confirm box with a user-defined message will pop up for every link in the page. Alternatively, set a specific CSS class of link that requires confirmation before proceeding, or a specific CSS class of link that does not. This is useful on pages where there is text being entered, such as creating a document or filling in a form. A new onclick event is assigned to all links so that a user will get a confirmation box before moving off the page. Using it without the optional parameters will assign the confirm box to ALL links. Using specific CSS classes allow you to fine-tune and add confirm boxes to only specific links.
To use Confirm Link, select a link on your page in Design view, open the Behaviors panel and select Tom-Muck.com > Confirm Link. Type in your confirmation message and click OK. The behavior was applied to the download link at the bottom of this page.
To use Confirm All Links, select Tom-Muck.com > Confirm All Links from the Behaviors menu. That brings up the following dialog box:
If you have a specific CSS class of links that are to be confirmable, type it in. If you have a specific class of links that is NOT confirmable, type that in also. The Confirmation Message is also optional, but you can create your own message to pop up to the user.
You can see a modified version of the behavior in action at http://www.ezgram.com/compose.cfm. If the user has modified his letter or created a new one, any link on the page that takes the user off the page pops up a confirmation box.
I have tested on the major browsers (IE, Firefox, Safari) but it should work in others. If you find any problems, let me know via the contact form. It should work in all recent versions of Dreamweaver and UltraDev.