Hi there,
The following will validate an input field when the focus changes from it:
NWF$(document).ready(function() { // Select using a unique class name we have supplied, choose input child element. NWF$(".validateMe input:first-child").change(function() { // Check value of the input field and set style. if(NWF$(this).val() != "boo") { NWF$(this).css( { "border-color": "#FF0000", "border-width":"2px", "border-style":"solid"} ); } else { NWF$(this).css( { "border-color": "#000", "border-width":"1px", "border-style":"solid"} ); } }); });
In the above example we check the input field with the class 'validateMe' associated with it. If the input field does not have a value of "boo" when changed then a red border is applied, a black border is applied when the input value equals "boo".
Ensure the input field has the unique css class so it can be located:
Put the validation JavaScript straight into Settings > Custom JavaScript.
You would also need to validate this on form save as the above will not prevent the user form saving invalid items.
Hope this gets you started.