I am passing some values through a link "Like",I want to set the property such that the link is hidden or disabled if it is clicked once..
have tried this codeonclick="this.style.display='none';"
But it does not seems to be working.Please help as where to put the js or any other alternate method..
<a href="like1?sellerid=<s:property value="id"/>&property_id=<s:property value="p_id"/>"onclick="hide">Like</a>;'
As it has been said this functions is better to be implemented with javascript. First assign a valid id for the link and follow this:
//create a function for the click like:
$('#buttonId').click(hideButton);
Afterwards, in your javascript code:
function hideButton(){$('#buttonId').css({'visibility':'hidden'})};
Remember to import jquery library and import the .js when your code has been displayed if you does not use a .ready function.
Edit: note that in the way previously exposed you will still get the box where the link was, but it is displayed hidden.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With