rice-framework/krad-web/src/main/webapp/krad/scripts/krad.actions.js
/**
 * Performs client side validation on the list of given controls and returns whether the controls
 * are valid
 *
 * @param controlsToValidate - list of controls (jQuery wrapping objects) that should be validated
 */
Performs client side validation on the list of given controls and returns whether the controls
are valid

@param controlsToValidate - list of controls (jQuery wrapping objects) that should be validated
Performs client side validation on the list of given controls and returns whether the controls are valid @param controlsToValidate - list of controls ( jQuery wrapping objects ) that should be validated
function validateLineFields(controlsToValidate, writePageMessages) {
    var valid = true;
    var invalidId = "";
    if (!validateClient) {
        return valid;
    }
    jQuery.watermark.hideAll();
    clientErrorExistsCheck = true;
    var tempMessagesSummariesShown = messageSummariesShown;
    messageSummariesShown = false;
    controlsToValidate.each(function () {
        var control = jQuery(this);
        var fieldId = jQuery(this).closest("div[data-role='InputField']").attr("id");
        var field = jQuery("#" + fieldId);
        var parent = field.data("parent");
        var validValue = true;
        control.removeClass("ignoreValid");
        haltValidationMessaging = true;
        if (control.length && !control.prop("disabled") && !control.is("span")) {
            control.valid();
            if (control.hasClass("error")) {
                validValue = false;
            }
        }
        var data = getValidationData(field);
        handleMessagesAtGroup(parent, fieldId, data, true);
        haltValidationMessaging = false;
        if (control.not(":visible") && !validValue) {
            cascadeOpen(control);
        }
        if (!validValue) {
            valid = false;
            if (invalidId.length == 0) {
                invalidId = this.id;
            }
        }
        control.addClass("ignoreValid");
    });
    clientErrorExistsCheck = false;
    messageSummariesShown = tempMessagesSummariesShown;
    if (writePageMessages && messageSummariesShown) {
        writeMessagesForPage();
    }
    jQuery.watermark.showAll();
    if (invalidId.length != 0) {
        jQuery("#" + invalidId).focus();
    }
    return valid;
}
function validateLineFields ( controlsToValidate , writePageMessages ) { var valid = true ; var invalidId = "" ; if ( ! validateClient ) { return valid ; } jQuery . watermark . hideAll ( ) ; clientErrorExistsCheck = true ; var tempMessagesSummariesShown = messageSummariesShown ; messageSummariesShown = false ; controlsToValidate . each ( function ( ) { var control = jQuery ( this ) ; var fieldId = jQuery ( this ) . closest ( "div[data-role='InputField']" ) . attr ( "id" ) ; var field = jQuery ( "#" + fieldId ) ; var parent = field . data ( "parent" ) ; var validValue = true ; control . removeClass ( "ignoreValid" ) ; haltValidationMessaging = true ; if ( control . length && ! control . prop ( "disabled" ) && ! control . is ( "span" ) ) { control . valid ( ) ; if ( control . hasClass ( "error" ) ) { validValue = false ; } } var data = getValidationData ( field ) ; handleMessagesAtGroup ( parent , fieldId , data , true ) ; haltValidationMessaging = false ; if ( control . not ( ":visible" ) && ! validValue ) { cascadeOpen ( control ) ; } if ( ! validValue ) { valid = false ; if ( invalidId . length == 0 ) { invalidId = this . id ; } } control . addClass ( "ignoreValid" ) ; } ) ; clientErrorExistsCheck = false ; messageSummariesShown = tempMessagesSummariesShown ; if ( writePageMessages && messageSummariesShown ) { writeMessagesForPage ( ) ; } jQuery . watermark . showAll ( ) ; if ( invalidId . length != 0 ) { jQuery ( "#" + invalidId ) . focus ( ) ; } return valid ; }
Performs client side validation on the list of given controls and returns whether the controls
 are valid
Performs client side validation on the list of given controls and returns whether the controls are valid
// skip completely if client validation is off
 // Turn on this flag to avoid prematurely writing out messages which will cause performance issues if MANY
 // fields have validation errors simultaneously (first we are only checking for errors, not checking and
 // writing simultaneously like normal)
 // Temporarily turn off this flag to avoid traversing unneeded logic (all messages will be shown at the end)
 // remove ignoreValid because there are issues with the plugin if it stays on
 //details visibility check
 // Toggle the flag back to default
 // Message summaries are going to be shown
 // Finally, write the result of the validation messages
