Jump to content

field validation before displaying HTML


This topic is 8561 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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%7Boption%7D function in it, then check to see whether the calc field is "1" if no image, or "0" an image is present.

Link to comment
Share on other sites

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).]

Link to comment
Share on other sites

This topic is 8561 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.