JavaScript alert box with confirm on button press -
i have link:
<p id="accept-favor"><a title="accept favor" href="?wp_accept_favor=<?php comment_id(); ?>">accept favor</a></p>
i want show javascript alert box when user clicks saying: "are sure accept reply favor?" 2 buttons 1 saying "yes" allow function run , other saying "no" cancel postback , keep user on page.
how this? :)
you can confirm onclick:
<p id="accept-favor"><a title="accept favor" href="?wp_accept_favor=<?php comment_id(); ?>" onclick="return confirm('are sure accept reply favor?');" >accept favor</a></p>
though ok/cancel instead of yes/no. if want yes/no, you'll have use custom dialog.
Comments
Post a Comment