As said, these functions are best implemented using javascript. First assign a valid identifier for the link and do the following:
//create a function for the click like: $('#buttonId').click(hideButton);
Then in your javascript code:
function hideButton(){$('#buttonId').css({'visibility':'hidden'})};
Remember to import the jquery library and import .js when your code has been displayed, unless you use the .ready function.
Edit: note that in the same order as before, you still get the field where the link was, but it appears hidden.
source share