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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -