Webmastersite.net

Search    Register    Log In   

1 matching result for "jqueryui":

Show listings, ordered by


By on Jan 12, 2016 at 9:55 PM

Sometimes, users act before they think. Those big inviting delete buttons on their file attachments when editing a listing may get clicked without good reason, and then the file is lost. The solution? A confirmation yes/no dialog.

The 9.2.40 Beta 1 release adds a new javascript handler function to help with this, named wsn_makeconfirmdialogajax. It takes two parameters: the first is the name of another javascript function which will be called when the user says 'yes' to the dialog, and the second is the value of a parameter to pass to that function.

You can use this function to make a confirmation dialog for any javascript event. If you'd like to make a confirmation dialog for a simple url redirect event, use the wsn_makeconfirmdialog function instead -- the only parameter you need to pass to that is the destination URL.

For confirming file attachment deletion, we'll just need to go to Admin -> Themes -> Manage Templates -> File Uploader. In that template, replace wsn_deleteattachment({%=file.attachid%}) with wsn_makeconfirmdialogajax('wsn_deleteattachment', '{%=file.attachid%}') and replace wsn_deleteattachment({ATTACHID}) with wsn_makeconfirmdialogajax('wsn_deleteattachment', '{ATTACHID}')

That's all, you're done!

Please note that as of now this solution is only good for English-only websites because the dialog prompt can't be translated without a very awkward workaround. If you need a multilingual solution, please contact WSN support.
Narrow results to results containing

Link to these search results