Hey all,
Normally you can use the :confirm functionality of link_to_remote to
specify the text of a confirmation dialogue.
For example, :confirm => “hello” generate:
<a href="#" onclick="if (confirm(‘hello’)) { new Ajax.Request …
I’d like to replace “hello” with a JavaScript call (so that the
confirmation dialogue can contain text based on what a user has so far
done on the page. If I try to pre-emptively close the quote, it ends up
just getting escaped, and the function name is simply displayed:
:confirm => “’+myFunction()”
<a href="#" onclick="if (confirm(’’+myFunction()’)) { new Ajax.Request
…
Any idea how I might accomplish a dynamic confirmation dialogue?
Thanks!!
-Jason