Heading to the Printing United trade show? Schedule a meeting with our representatives.

validateUserInfo Method

Callable

  • Validates the UserInfo structure.

    example
    var editor = null;
    var data = {
        "Name": "Alex Smith",
        "Position": "Manager",
        "ID": {
            "BarcodeFormat": "EAN_8",
            "BarcodeValue": "1234567"
        }
    };
    
    // Load the web-to-print editor.
    CustomersCanvas.IframeApi.loadEditor(iframe, product, configuration)
        .then(function (e) {
            editor = e;
        });
    ...
    
    // Validate userInfo.
    editor.validateUserInfo(data).then(function (r) {
        if (r.error) {
            // Output the error.
            console.error(r);
            return;
        }
        
        // Populate the product with valid user data.
        editor.loadUserInfo(data);        
    })
    

    Parameters

    • data: IUserInfo

      An object, which holds key-value pairs. The key is a layer name or an in-string placeholder name without markers and extra symbols. The value is a text or barcode date you want to load into the editor.

    Returns Promise < IValidationResult >