Domino's Rogue P Tags

I spent half an hour the other day pulling my hair out trying to track down the source of a rogue <p> element that was screwing with a page's layout. Well, I deserved a good kicking for not having known what the problem was straight-away. It was, of course, Domino!

As you all probably know by now I like to create as much of the HTML as possible by myself. I don't like Domino doing it for me. If you've seen any of the downloads on this site you'll have seen that all my forms are full of PassThru HTML. Basically, this is as close as you can get to making your own pages without using "Treat page contents as HTML", which is all but useless. Well, the problem is that Domino still manages to squeeze some of its own HTML in there. Take the situation shown below for example:

Imagine this field has to not be PassThru HTML, for one reason or another. So, it's on its own line that isn't marked as HTML. The problem comes about depending on the way you achieve this. Say you write all the HTML and then add the field. Then you mark the lines above and below the field as "passthru". This is when you would get the P tag appearing, after the </label> and before the <input>. Why? Because of the line-break between them! Domino take this new line and renders it in the browser as a <p>. Stupid, I know. If there were two new lines then I'd understand. With one new line would not a <br> make more sense?

Anyhow, the solution: if ever you need/want to have some none PassThru (PT) HTML in among all your other PT make sure you create the new line within the PT and end it on the next linem, as below:

Can you see how the PT carries down a line, continues for a few spaces and then gets turned off? We then then have the none-PT stuff and a few more spaces* of PT so we can have another new line. Alternatively you can simply have it all happen on one line, as below, but this isn't always pretty:

Luckily, there aren't ever that many occasions when you need to come out of PT-mode. Sometimes you have to though. For example, when adding categorised views. When you do need to, be careful how you go. Don't let Domino create any more HTML than it has to.

* Like nature abhors the vacuum, HTML abhors the space. Add as many spaces as you like in a line, they won't render in the browser!


    • avatar
    • Chris M
    • Tue 1 Mar 2005 01:41

    Don't you just love the black art that is Domino....?

    • avatar
    • Jake
    • Tue 1 Mar 2005 01:55


  1. What about this situation:

    You have a rich-text field in Notes, and the users populate it with normal text.

    Domino does not treat the first paragraph as a paragraph in html. So the line-spacing between the first paragraph and second paragraph is missing in the web-browsers.

    One solution I found to get around this to to tell the users to press the space-bar in the line betwee the two paragraphs. - It doesn't matter whether you use PT or not on the RichText field .. :-(

    Anybody know of which black magic ritual I need to perform to fix this problem?

  2. Had similar problems myself with embedded views (which you have to switch out of pass-thru HTML for.

    If you move your cursor around the view the cursor will suddenly go very small (like a 6pt font), when the cursor is there you can turn off pass-thru HTML and this ensures the view gets rendered even if the surrounding text is pass-thru.

    Really strange!

  3. Funny that one - I've never had the same problem within normal Passthru HTML and Domino Field structures, but I have had exactly that problem when using the Embedded File Upload control.

    My solution, which took many hours to figure, was exactly the same.

  4. I'm actually trying a new approach based on an IM conversation that I had with Andrew Barker {Link} - hand-written html forms that write to the notes document via the form's "post".

    VERY ingenious approach - which to date only has one drawback that I can see; the inability to edit a document. Obviously with enough cracking we should be able to lick this and provide a Domino Web Developer the ability to completely control the HTML sent to the browser while creating documents in the database.


  5. Great tip Jake!

    I had an issue with a mysetiously appear line break (not a <p>) it could be a simular issue to the one you decscribe...

    Anyone else get myserious appearing <br>?


  6. I had the same problem as Tyron with the file upload control and Pass through HTML. Rarely do I use file uploads so I normally forget and spend hours tracking down the problem. After my last incident I decided to make it a habit of putting a non-pass thru HTML space in front and back of the file upload control. Voila - the control doesn't mysteriously disappear on the web page anymore!

    What a joke Domino is at times.

    • avatar
    • Louis
    • Tue 1 Mar 2005 10:26

    Like Jake I use tons of PassThru HTML and discovered that it created all kinds of problems when I'm developing cause I was doing lots of cutting and pasting of stuff. (I think it is has to do with how you highlight either the first or last "characther" of the content being cut and then where you place the cursor when you paste it. End or start of paragarph is not end or start of paragarph.) So, for the longest time the trick I used was to highlight all the PassThru HTML and turn it off, then check to see that it indeed is off - sometimes the tick box stays checked eventhough the text was not highlighted and that just about always indicated a problem at display time. Then I would painstaking try to identify the cause.

    Now with CSS I now develop the "element" individualy on seperate notes design elements. Once I'm happy with it I then "plug" it into the final form. I find that this allows me to easily identify where the display "big" is and apply a patch is need be by wraping it is a custom tag.

    In situations where I need greater control, I'm strying away from using embedded views and using agents in their place.

    • avatar
    • Jake
    • Tue 1 Mar 2005 11:56

    Glad I'm not the only one being driven nuts. There are so many ways in which PassThru sucks. This scenario is just *one* of the little gotchas I know about. The others are just too obscure to even mention. Chris M nailed it when with the "black art" comment. What worries me is that mind must have a finite space for web-dev knowledge. How much of it is taken up with nonsense like knowing how to deal with PT!?

  7. I actually have cracked that nut already, hand-written xhtml forms in domino, used for reading, editing and creating documents. My blog template is built using this technique, and its freely available at {Link}

    I hope this doesn't sound like an ad, I definitely don't mean to!

    • avatar
    • Dragon Cotterill
    • Tue 1 Mar 2005 18:20

    I'm having issues with plain ordinary HTML passthru on subforms. I'm in the process of re-writing one of my clients websites. {Link} (which is some 6 years old now - written in 4.6) and I have a new version here {Link} - where you will see the problems.

    The entries down the left hand side (Menu, Search, Shopping Basket etc.) are all subforms. All Passthru HTML. Yet there are serious spacing issues between them. I think that Domino is putting a rogue tag in with the subforms causing the spacing to be offset somewhat.

    Damned annoying.

    • avatar
    • Ben
    • Wed 2 Mar 2005 03:18

    Could this be the catch-phrase we've all been looking for? "Domino - 'P'eeing all over your code since 1983" ;)

    • avatar
    • Caroline McGrath
    • Wed 2 Mar 2005 08:35

    Occasionally I get rogue <p>s without the field issue. I create some pass thru HTML and then stop. Then I press return, then I create some more pass thru HTML. The turning off and turning on of HTML between lines catches me out sometimes. The solution I find is to hightlish chunks of code and convert them to pass thru HTML in one go, rather than line by line.


    • avatar
    • Chad
    • Wed 2 Mar 2005 10:18

    I also got so frustrated with the PT that I started using the [] around the text because of not knowing when PT started and stoped. So far this has been working for me.

Your Comments


About This Page

Written by Jake Howlett on Tue 1 Mar 2005

Share This Page

# ( ) '


The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social

About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »


Here are the external links posted on the same day.

More links are available in the archive »

More Content