I have to jquery to show dialog box , but there is a problem, I have multiple buttons of similar name, example : btnEditUser-1, btnEditUser-2, btnEditUser-3
I have to call same function for every buttons to call AJAX function.
Please suggest how can I do it?
Please find the html/javascript code for reference:
cakephp code to print html
if($user['id']=="1" or ((strtotime(date("Y-m-d"))-strtotime($searchres[$i]['documents']['uploadtime']))<172800))
{
echo $this->Form->button('Edit User', array('type'=>'button','id'=>'edituser-'.$id,'name'=>'edituser-'.$id,'value'=>$id));
}
I have to write following function in jquery which recieve the value sent by button(mentioned above):
function showedituser(doc_id) {
var data = {doc_id : doc_id};
var divname = $('#dialog-edituser');
$("#dialog-markup").dialog("open");
var url = 'documents/getassigned_users';
callajax(url, data, divname);
return false;
}