I have a link to a page which invokes the ‘Sexy Alert Box’ script to pop a message asking if users agree to Terms and Conditions with options “I Agree” and “Cancel”.
I’ve got that much going but now I need for the “I Agree” option to send them to a new page. (“Cancel” returns the user the current page.)
Something to do with document.location.href?
I am using the mootools framework.
Sexy Alert Box 1.2 mootools & jQuery
Here’s the code:
<a href="#"
onclick="Sexy.confirm('Do you agree to the terms and conditions?', {
textBoxBtnOk: 'I Agree', // goes to www.newpage.com
textBoxBtnCancel: 'Cancel' // return to current page
});">Link</a>
The standard, built-in javascript
confirmfunction will return true or false, depending on the button pushed (this is a synchronous action), but thisSexy.confirmplugin looks like something that is going to return its choice via callback functions (it will be an asynchronous action).For example,
And then you can make your link tags a little nicer,
Good luck!