« Back to home

XPages, Bootstrap, and form validation

I’ve recently been experimenting with Bootstrap for page layout, now that it’s an official part of the XPages Extension Library for Domino. After some simple test pages, I decided to put together a standard data entry form to see how painful that was. A typical Bootstrap form’s HTML for a single field looks like this: <div class="form-group"> <label for="email1">Email address</label> <input type="email" class="form-control" id="email1" placeholder="yourid@example.com"> <span class="help-block">Your Internet e-mail address</span> </div> If you have a validation error to display, and want to show a feedback icon, the HTML balloons up to something like this:…

Read more »

Controller-based server-side validation in XPages JavaScript

Think about your last tax return. If you have investment income, a whole additional set of questions has to be answered. If you own overseas investments, that’s another set of fields to fill out. Disposed of any stock? That’ll be more questions. My experience is that most business forms end up like this. They start out simple, but sooner or later someone says “Well, if they answer yes to this question, we’ll need to ask them another question with three possible answers, and depending on their answer they might need to put a project code in another field…” and suddenly you’re off down the dynamic forms rat hole.…

Read more »