<p>Make sure to add an if statement to check if the value exist or not with the <a href="https://docs.craftcms.com/v3/dev/filters.html#length" rel="nofollow noreferrer">length filter</a> for example.</p>

<pre><code>{% if entry.videoPhoto50 | length %}
   &lt;img src="{{ entry.videoPhoto50  .....
   ....
{% endif %}
</code></pre>

<p>So that your code is only executed if <code>entry.videoPhoto50</code> has a value.</p>

CC BY-SA 4.0
2019-08-09T16:33:26.977Z
Thanks, this works!
Sebastiaan Schillebeeckx
CC BY-SA 4.0
2019-08-05T10:35:11.033Z
2019-08-06T08:13:29.447Z
2019-08-06T08:13:29.447Z
Christopher Dosin
<p>I made a content page (Channel) where the client can add a bunch of content. There will be multiple pages (1 page for every case) with the same layout. Sometimes they don't want to fill in every input field or asset. When they leave a field blank, I get an error.</p>

<p>Is it possible to just not show the parts they didn't fill in?
For example: When I put the website in 'production' they show the broken IMG instead of nothing.</p>

<p><a href="https://i.sstatic.net/kGA3D.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kGA3D.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/V2emS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/V2emS.png" alt="enter image description here"></a></p>

<channels>
How to show nothing when you leave an input field empty in the entries instead of showing an error?
# How to show nothing when you leave an input field empty in the entries instead of showing an error?

(Asked by: username_0 on 2019-08-05)

I made a content page (Channel) where the client can add a bunch of content. There will be multiple pages (1 page for every case) with the same layout. Sometimes they don't want to fill in every input field or asset. When they leave a field blank, I get an error.

Is it possible to just not show the parts they didn't fill in?
For example: When I put the website in 'production' they show the broken IMG instead of nothing.

[![enter image description here](https://i.sstatic.net/kGA3D.png)](https://i.sstatic.net/kGA3D.png)

[![enter image description here](https://i.sstatic.net/V2emS.png)](https://i.sstatic.net/V2emS.png)

**Tags:** channels


---

## 1 answers

### Answer by username_1 on 2019-08-05. Score: 2 | Accepted answer

Make sure to add an if statement to check if the value exist or not with the length filter for example.
{% if entry.videoPhoto50 | length %}
   <img src="{{ entry.videoPhoto50  .....
   ....
{% endif %}
</code>
So that your code is only executed if entry.videoPhoto50 has a value.

> **Comments:**
> **username_0**: Thanks, this works!  

---

