Ajax Error when removing CREATE button from detail view


I have created some custom modules and I was trying to remove CREATE button from detail & edit view. The below code works fine for all modules with a custom view.detail.php & view.edit.php. But for a specific module which if FILE type, it doesn’t work in detail view only & opens a blank window with {“content”:". & in bottom If this error persists, please have your administrator disable Ajax for this module

The code i am using in view.detail.php & view.edit.php is.

print ‘#create_link, #create_image{ display:none; }’;

The same code works fine in all other module to disable create button, even for the same module in edit view, the problem is coming only in detail view.
Please suggest what can I do to avoid this.

I need to remove create button from edit & detail view & except this I have done from all other custom modules.

“Please consider me a noob while replying”


Try the following:

print '<style type="text/css">#create_link, #create_image, a#create_link.utilsLink{ display:none; }</style>';

Kind Regards,


Thanks Will, still the same error, I have attached screen shot.