Name

global.IPAddressValidator

Description

Validates whether given value represents a valid IPv4 or IPv6 address.

Script

var IPAddressValidator = Class.create();
IPAddressValidator.prototype = Object.extendsObject(AbstractAjaxProcessor, {

  ajaxFunction_validateDesktop: function() {
  	var table = this.getParameter('table');
  	var fields = this.getParameter('fields');
  	var values = this.getParameter('values');
  	return JSON.stringify(IPAddressDataFormatter.areColumnsValid(table, fields, values));
  },
  
  ajaxFunction_validateMobileAndServicePortal: function() {
  	var table = this.getParameter('table');
  	var field = this.getParameter('field');
  	var value = this.getParameter('value');
  	return IPAddressDataFormatter.isColumnValid(table, field, value);
  },
  
  ajaxFunction_validateStrict: function() {
  	var ip = this.getParameter('ip_value');

  	return SncIPAddress.isValid(ip);
  },

  
  type: 'IPAddressValidator'
});

Sys ID

68d2e517c38722007bf1bea192d3aeb6

Offical Documentation

Official Docs: