gproulx
Posts: 68
|
| Posted: 06/15/2006, 8:59 AM |
|
Hi,
it is possible to not display the image icon if the content of the field linked to that image is empty?
For example, i have a page where i can upload a file and the image name of the upload file are store in the field 'picture'.
Then, when i display the image, i make this little custom code in the HTML to display the image that are in another folder. ex. <img src="imagesUP/{Label1}">
In Conception mode, my label icon turned to an image icon and i did'nt have access anymore to the data windows but, that is not so important cause all works anyway.
But on my page, if the field for that image is empty, an image icon appears. (like no image was found). Is it possible to not show it, make it invisible if the field are empty?
For the moment i put a little white image as a patch.
Thanks in advance
|
 |
 |
peterr
Posts: 5971
|
| Posted: 06/15/2006, 10:42 AM |
|
You can:
1. Create a replacement image that contains 1 pixel or some white area, or an image that says "No Image", etc. Then use the "Before Show" event of your label to check if the Label value is blank, and if it is then stuff the name of that empty replacement image into the Label.
or 2. Convert your HTML code to just {Label1} and then use the Before Show event of that label to display your images, or don't display anything if there is no image. For example:
If FormName.Label1.Value <> "" Then FormName.Label1.Value = "<img src='imagesUP/" & FormName.Label1.Value & "'>" Else FormName.Label1.Value = "" (untested)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
geny
|
| Posted: 06/15/2006, 11:26 AM |
|
Thanks Peter,
I did your number 2 solution and it work just like i want!
Thanks a lot
|
|
|
 |
Rey
|
| Posted: 06/21/2006, 6:36 PM |
|
To not display the image icon if the content of the field linked to that image is empty,
Bring up the page with the image of the Image Link, left click on the red form container. Obtain the form name from the properties window, now left click on the Command Image Link. Obtain the Image link name . use this example for your script:
If form_name. Image_link_name.Value = "" then form_name. Image_link_name.Value = " dot.gif "
Underneath is the script I use on my site.
If articles1.images_url.Value = "" then articles1.images_url.Value = "NoPhoto.gif"
Now Insert the script in the Before Show event of the label of your Image_link that will display your image. Publish and test, good luck.
|
|
|
 |
|