Add Image to WebControl.RichImageField client-side Sharepoint 2007
-
16-10-2019 - |
Question
Situation:
I've got a pagelayout with 3 LanguagePanels with in everyone a RichImageField. Above these languagepanels, i've got a "General info" panel with a textbox for an url.
In edit mode, if I want to add an image to each languagepanel, that's possible, but when an url is filled in in the "General info"-panel, the image should be loaded in all the RichImageFields of the LanguagePanels.
I thought of doing this client-side (javascript). But I don't know how to set this (if it is even possible...)
Controls:
<TranslationWebControls:LanguagePanel ID="NL" runat="server">
<WebControls:RichImageField ID="RollupImageNewsItemNL" runat="server" />
</TranslationWebControls:LanguagePanel>
<TranslationWebControls:LanguagePanel ID="FR" runat="server">
<WebControls:RichImageField ID="RollupImageNewsItemFR" runat="server" />
</TranslationWebControls:LanguagePanel>
<TranslationWebControls:LanguagePanel ID="EN" runat="server">
<WebControls:RichImageField ID="RollupImageNewsItemEN" runat="server" />
</TranslationWebControls:LanguagePanel>
Anyone knows how to solve this client side (if possible with javascript)???
If you know a better way to do this, please do tell...
Solution
If you want to set the value of a rich text field with client side script, this blog post may help: http://sympmarc.com/2011/05/25/setting-a-rich-text-column-in-a-sharepoint-form/ I'm not sure that the control for an image field is exactly the same in the DOM, but this should get you close.