Click here to Skip to main content
15,917,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<td><a class="edit" title="Accept" href="javascript:void()" onclick="get_accept('<?php echo $data['id'];?>');" >Accept</a></td>


how can i disable or disappear this Accept button from the page after first click because i am sending a timestamp value from this button and when a user click this button after some time then it will get new timestamp.
please help.
Posted
Updated 25-Jul-12 7:16am
v2

1 solution

Send the button itself as a variable to your function.
HTML
<a onclick="get_accept('<?php echo $data['id'];?>', this);" class="edit" title="Accept" href="#">Accept</a>

Then disable or hide it in your javascript.
JavaScript
function get_accept(data, sender)
{
  sender.disabled = true;
  //OR
  sender.styles.display = "hidden";
}
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900