How to use the address.field.cannot.be.empty function in address

To help you get started, we’ve selected a few address examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wso2 / carbon-mediation / components / mediation-ui / org.wso2.carbon.endpoint.ui / src / main / resources / web / endpoints / js / httpEndpoint-validate.js View on Github external
function validateHttpEndpoint(isAnonymous,isFromTemplateEditor) {
    if (!isAnonymous) {
        if (isValidName('endpointName')) {
            CARBON.showWarningDialog(jsi18n['name.field.should.be.valid']);
            return false;
        }
    }

    if (isEmptyField('url')) {
        CARBON.showWarningDialog(jsi18n['address.field.cannot.be.empty']);
        return false;
    }

    if (!isFromTemplateEditor) {

        // check for a valid URL
        var endpointURI = getElementValue('url');
        if (endpointURI != null) {
            if (!isValidURL(endpointURI)) {
                CARBON.showWarningDialog(jsi18n['invalid.url.provided']);
                return false;
            }
        }

        var durationVal = getElementValue('suspendDuration');
        if (durationVal != null) {
github wso2 / carbon-mediation / components / mediation-ui / org.wso2.carbon.endpoint.ui / src / main / resources / web / endpoints / js / addressEndpoint-validate.js View on Github external
function validateAddressEndpoint(isAnonymous,isFromTemplateEditor) {
    if (!isAnonymous) {
        if (isValidName('endpointName')) {
            CARBON.showWarningDialog(jsi18n['name.field.should.be.valid']);
            return false;
        }
    }
    if (hasKeyWord('endpointName')) {
        CARBON.showErrorDialog(jsi18n['name.field.cannot.be.keyword']);
        return false;
    }

    if (isEmptyField('url')) {
        CARBON.showWarningDialog(jsi18n['address.field.cannot.be.empty']);
        return false;
    }

    if (!isFromTemplateEditor) {

        // check for a valid URL
        var endpointURI = getElementValue('url');
        if (endpointURI != null) {
            if (!isValidURL(endpointURI)) {
                CARBON.showWarningDialog(jsi18n['invalid.url.provided']);
                return false;
            }
        }

        var durationVal = getElementValue('suspendDuration');
        if (durationVal != null) {