Syntax to test whether a media file has been selected
Hi All,
I have images located in a folder in my media section and I have the code working so that if a user selects an image via the media picker data type it displays it fine but I want to put an awaiting photo image in place if they decide not to select an image.
The first if Test is working fine but the second if test wont seem to pull in the awaiting image png that I am storing in an images folder located with the rest of the installation files.
I think im on the right lines but the sytax is wrong somewhere. can anyone please help me out.
And try to check if the path is correct for the image. You can check the path in firebug or chrome developer tools, by doing this can get an idea of if it´s the correct path.
One thing you also could try is just remove the if statement, just to make sure that the path to the image is correct, then you know that the if statement is the problem.
Syntax to test whether a media file has been selected
Hi All,
I have images located in a folder in my media section and I have the code working so that if a user selects an image via the media picker data type it displays it fine but I want to put an awaiting photo image in place if they decide not to select an image.
The first if Test is working fine but the second if test wont seem to pull in the awaiting image png that I am storing in an images folder located with the rest of the installation files.
I think im on the right lines but the sytax is wrong somewhere. can anyone please help me out.
Thanks
Paul
Hi,
I found a solution to get around this. After realising that the value was of type string i used the following test
Seemed to work and is displaying the image so happy days. Perhaps I should think a bit harder next time lol
Thnaks Paul
Hi Paul,
What if you are doing it this way:
And try to check if the path is correct for the image. You can check the path in firebug or chrome developer tools, by doing this can get an idea of if it´s the correct path.
One thing you also could try is just remove the if statement, just to make sure that the path to the image is correct, then you know that the if statement is the problem.
Hope this helps,
/Dennis
Hi Dennis
Thanks for your prompt response. Ive managed to solve the issue i was having pretty much how you suggested :)
I just needed to think a bit harder lol
Cheers mate
Paul
is working on a reply...