// Provjeri da li je vrijednost nešto smisleno, npr da li je array pun
if (typeof array[index] !== 'undefined' && array[index] !== null) { }
/* VALIDATION */
/*
* If the value is null and not required, we don't need to run through validation
*/
if (!field.value || field.value === '' || typeof field.value === 'undefined') {
return;
}
// Regex za validation !!
var ruleRegex = /^(.+)\[(.+)\]$/,
numericRegex = /^[0-9]+$/,
integerRegex = /^\-?[0-9]+$/,
decimalRegex = /^\-?[0-9]*\.?[0-9]+$/,
emailRegex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,6}$/i,
alphaRegex = /^[a-z]+$/i,
alphaNumericRegex = /^[a-z0-9]+$/i,
alphaDashRegex = /^[a-z0-9_-]+$/i,
naturalRegex = /^[0-9]+$/i,
naturalNoZeroRegex = /^[1-9][0-9]*$/i,
ipRegex = /^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i,
base64Regex = /[^a-zA-Z0-9\/\+=]/i;
// Koristi se: npr.: emailRegex.test('tvlahovi@gmail.com') -> Vraca true ili false