disable delete button from the edit page for photo upload

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
innovativeshadow
User
Posts: 86
Location: Almaty, Kazakhstan

disable delete button from the edit page for photo upload

Post by innovativeshadow »

Hi,

can anyone please give me a solution.

I have an edit page, I want the user to add photos but not allow to delete the old once.

How to achieve this please, I was unable to hide the delete button in startup script for edit page using:

$('.btn.btn-default.btn-sm.delete').hide();

what am i doing wrong?

Thank you


anil
User
Posts: 24

Post by anil »

Place this code in Client Scripts->Edit Page->Startup Script..
$("#btnCancel").hide();


innovativeshadow
User
Posts: 86
Location: Almaty, Kazakhstan

Post by innovativeshadow »

Hi Anil,

Thank you for the reply, Not working.

I want to hide the delete photo button in upload.

if possible of course for the old photos only


kirondedshem
User
Posts: 642

Post by kirondedshem »

Your code seems to work if i run it after the form loads and I saw if its too immediate it will run too early, so whne i combine running it after the page loads and maybe put a timer for like a few milliseconds it works.
So paste in startup script:
$(document).ready(function() {
setTimeout(function(){
$('.btn.btn-default.btn-sm.delete').hide();
},300);//adjust time
});


Post Reply