ctaylor Posted December 8, 2000 Posted December 8, 2000 Is there anyway to test a field in a database for contents before displaying some HTML code? Example: I am trying to test to see if there is an image in one of my fields before I put a link to that image. Some of my records will have images and others won't and I don't want some of my records to have bad links. I tried doing a boolean test on the field hoping that filemaker would return a true if an image was there and a false if not. That didn't work. I would appreciate any idea. Thanks in advance. Chris Taylor
Simonpennington Posted December 9, 2000 Posted December 9, 2000 The way I do it (which is probably long winded) is to make the field that states the route to the picture have an auto entry of "none" and then put on the page [fmp-if: picturelink.eq.none][fmp-else]<img src="http://www.mydomain.com/pictures/[fmp-field: picturelink]">[/fmp-if] This shows the picture if you have added a link, and no picture if you haven't. If you are having the picture in a container field, then I don't know haven't had to think about it, as I found having pictures served this way to the web from filemaker was very slow. Hope this helps Simon
Vaughan Posted December 9, 2000 Posted December 9, 2000 Simon is right regarding the use of the [FMP-If] statement. My only improvement is not to use an autoentered field, instead use a calculation field with the IsEmpty function in it, then check to see whether the calc field is "1" if no image, or "0" an image is present.
Anatoli Posted December 11, 2000 Posted December 11, 2000 quote: Originally posted by ctaylor: Is there anyway to test a field in a database for contents before displaying some HTML code? Example: I am trying to test to see if there is an image in one of my fields before I put a link to that image Chris Taylor [FMP-if: picture.neq.] FM image here [FMP-Else]Picture not in databaze.[/FMP-if] always worked for me. [This message has been edited by Anatoli (edited December 11, 2000).]
Recommended Posts
This topic is 9083 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now