Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Check this demo: <a href="https://github.com/trentrichardson/jQuery-Impromptu/blob/master/demos/user_manager.html" rel="nofollow">https://github.com/trentrichardson/jQuery-Impromptu/blob/master/demos/user_manager.html</a></p> <p>What you should do is make a function. This function is called when a user does something, but it should contain an ID. For example:</p> <pre><code>&lt;a href="javascript:;" title="Edit User" class="edituser" onclick="editUser(4);"&gt;Edit&lt;/a&gt; </code></pre> <p>So, as you can see you will call the function 'editUser(4)' where 4 is the ID.</p> <p>Back to JS</p> <pre><code> function editUser(id){ } </code></pre> <p>In this function you add your part, and you end up with this:</p> <pre><code> &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="../jquery-impromptu.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function removeUser(id){ var user = $('#userid'+id) var fname = user.find('.fname').text(); var lname = user.find('.lname').text(); var txt = 'Are you sure you want to remove this user with id: '+id+'?'; $.prompt(txt,{ buttons:{Change:true, Cancel:false}, submit: function(e,v,m,f){ var flag = true; if (v) { window.location = "deletemember.php?id=" + id; } return flag; } }); } &lt;/script&gt; &lt;a href='javascript:;' onclick='removeUser(544666);'&gt;Delete&lt;/a&gt; </code></pre> <p>Now the ID is useable for your window.location.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload