Nintex Forms – Custom Styles

This post is a bit of a follow up to my previous post on Basic Validation in Nintex Forms.

I wanted to cover the scenario where you’ve applied some custom styling to your text boxes and are finding that the required field validation around the input is no longer taking affect.

As an example, let’s assume you’ve gone ahead and removed the out of the box styling we see on a text box and applied your own:

Now if we take a look at the form Settings, we’ve setup our custom style as follows:

And so when we preview, we’ll see something like:

So far so good, however, when we test the validation, you’ll now notice that the red border around the input is gone:

In order to add this back, we’ll need to modify our ValidateTitle function so that we automatically apply a border when the validation fails. Here’s what this looks like:

1
2
3
4
5
6
7
function ValidateTitle(source, arguments) {
    arguments.IsValid = true;
    if (arguments.Value == "") {
        NWF$(".nf-custom-input").css("border","1px solid red"); 
        arguments.IsValid = false;
    }
}

Republish the form, and you should see something like:

As a final touch, you could add the red asterisk to the form, so that we end up with this as a final result:

Really powerful! Any questions, let me know.

,

Trackbacks/Pingbacks

  1. Nintex Forms – Custom Styles | SharePoint Development & Ops | ARB Security Solutions - SharePoint Security Integrators - January 16, 2013

    [...] SharePoint Blog Post From SharePoint Development – Google Blog Search: This post is a bit of a follow up to my previous post on Basic Validation in Nintex [...]

Leave a Reply