Conditionally display Image on form

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Conditionally display Image on form

Post by Jhstephenson »

I have a form that has a image attribute on it. I have set an HTML attribute so that it shows on the right side of the form.

The html looks like this:

Code: Select all

<div  id="imageshadow">
 	<img src=<<MediaFiles.MediaDocument>> height="300" width="400"/>
</div>
No problem with the display, except I only want to display it if it is not a video file (MP4 or AVI).

How can I condition that attribute for that?

Thanks,
Jim
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Conditionally display Image on form

Post by Jaymer »

FILE_EXTENSION()
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Conditionally display Image on form

Post by Jhstephenson »

Yeah, I know about that. But how do I put that in the HTML?
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Conditionally display Image on form

Post by customaware »

I would try this Jim..

<div id="imageshadow">
<<IF FILE_EXTENSION(MediaFiles.MediaDocument)<>'MP4' AND FILE_EXTENSION(MediaFiles.MediaDocument)<>'AVI' THEN SHOW SECTION_START>>
<img src=<<MediaFiles.MediaDocument>> height="300" width="400"/>
<<SECTION_END>>
</div>
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Conditionally display Image on form

Post by Jhstephenson »

Thanks Mark, that is what I was looking for. I had seen that before but for the life of me could not remember it.
Post Reply