Image substitution for empty rich text Field

This tip describes a procedure for image substitution for empty RT Field.

We had been searching for a way to display a 'no image available' image in our web-based catalog for some time. I found a method using simple JavaScript. This should work for any empty RT field displayed through a web browser. It seems that when an RT field is displayed in a form through a browser, domino puts in ecblank.gif when the field is empty as a placeholder in the html. This code reads that and substitutes in the new image in its place. In our case the image is image[0]. This would also work in a loop if there are many RT fields to replace.


Put the following at the bottom of your form. Substitute the name, width and height of your 'no image available' image.

<SCRIPT LANGUAGE=
JavaScript>
<!--
if(document.images[0].src.
indexOf('ecblank.gif')>0) {
window.document.images[0].src = 
'http://domain/icons/noboxshot.jpg';
window.document.images[0].height='168'
window.document.images[0].width='126'
}
//-->
</SCRIPT>
  
 
This was last published in May 2003

Dig Deeper on JavaScript for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close