Home > other >  How to show only empty squares if user does not upload any image instead of showing null icon
How to show only empty squares if user does not upload any image instead of showing null icon

Time:12-29

Here if user upload a image it will show the uploaded image. But in other case if user forget to upload images or images is not uploaded then instead of showing this iconenter image description here

I want to show only empty squares. So please let me know if it is possible. or How can we achieve this

CodePudding user response:

Did you try one rror with the image tag?

<img src="media.jpg" one rror="this.onerror=null; this.src='https://toppng.com/uploads/preview/and-blank-effect-transparent-11546868080xgtiz6hxid.png'"/>

something like this.

CodePudding user response:

you can make sure the url you are loading from is not null if it is instead of creating an image tag create a div that is styled as a box

  • Related