Expand my Community achievements bar.

Change URL of image field

Avatar

Former Community Member
How do I address the URL attribute of an image field in JavaScript?



I have an image field with a URL. All I need to do is have a drop down that changes the URL of an image field so a different picture can be shown. I'm able to use the drop down to change the presence of an image field but when I try to change imageField.presence to imageField.URL, nothing happens when I make a new selection in the drop down. I've also tried imageField.value.image.href but that doesn't work either.



Am I not referencing the URL attribute of the image field properly or doing something else wrong?
6 Replies

Avatar

Former Community Member
I also need to know how to do this. I have been struggling with this as well.



Any help would be extremely appreciated.

Avatar

Former Community Member
bump. Can this seriously be something no one knows how to do?

Avatar

Former Community Member
I have exactly the same problem. I'm trying to put an image field so the user can select an image, see it in the form and I can get back an xml with a tag including the href of the image. I can get the href info if I put an image in the original form, the one I send to the user, but if the user changes the image selecting another one the imagefield1.value.image.href code doesn't work at all.

Avatar

Former Community Member
I think this may have something to do with the fact that LiveCycle embeds all images on PDFs whether you want it to or not. I imagine if the images are embedded there really is no URL to change! This has to be some kind of bug because I can't seem to find so much as a reference to this in the documentation or discussion boards. If it isn't a bug or no way around it I'll have to find another solution for this project. Shame

Avatar

Former Community Member
I think it's a bug. Now I've tried to write the href in a text field with a global link to an image field and it works, I see the image displayed in my PDF. But it's impossible to make it the other way. Selecting the image I recover the raw value of the image in the text field but I can't recover the href. Maybe it's what you said, Live Cycle embeds images whether you want it or not.