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 first published in May 2003

Dig deeper on JavaScript for Lotus Notes Domino

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

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

SearchVirtualDataCentre.co.UK

Close