Hi good video, having watched, you mention about sharing some of the script code, are you able to send me these? would be great to view and write code more efficiently so seems a good starting place. Have tried the FormService but the others are interlinked. thank rich
@wanna_know_something7888 Жыл бұрын
var FormService = (function () { return { hideField: hideField, showField: showField }; function hideField (fieldName, clearValue) { g_form.setMandatory(fieldName, false); g_form.setDisplay (fieldName, false); if (toBoolean(clearValue)) { g_form.clearValue(fieldName); } function showField (fieldName, mandatory, readonly, value) g_form.setDisplay (fieldName, true); g_form.setMandatory(fieldName, toBoolean(mandatory)); g_form.setReadOnly(fieldName, toBoolean (readonly)); if (!isNil(value)) { g_form.setValue(fieldName, value); } function toBoolean (arg) ( if (!isNil(arg)) { if (isBoolean(arg)) { return arg; } else if (isString(arg)) { return arg === 'true' || arg === '1'; } else if (isInteger (arg)) { return arg === 1; } return false; } function isBoolean (arg) { return typeof arg 'boolean"; } function isInteger(arg) { return typeof arg === 'number' && isFinite(arg) && Math.floor(arg) === arg; } function isNil(arg) { return arg == null; } function isString(arg) { return typeof arg === 'string'; } })();