Difference between revisions of "SmartCheck Validation"
From SmartWiki
m |
m |
||
Line 18: | Line 18: | ||
result.addMsg('Please upload at least one file'); } | result.addMsg('Please upload at least one file'); } | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
====End date is before Start date -> Fail:==== | ====End date is before Start date -> Fail:==== | ||
<pre>if (datediff('@date(startdate)@','@date(enddate)@','d') < 0) | <pre>if (datediff('@date(startdate)@','@date(enddate)@','d') < 0) |
Revision as of 12:06, 4 December 2015
Contents
Examples
Number value greater than 5 -> Fail:
if(ssParseNum(form.getStr("cf_Store Value")) > 5) {result.isPassed=false; result.addMsg('Some message here'); }
End Date is before Start Date -> Fail:
if (datediff('@date(startdate)@','@date(enddate)@','d') < 0) {result.addMsg('End date must be later than Start date')); result.isPassed=false; }
Multi file upload field has no files -> Fail:
if(ssParseNum("@level1.MUlti upload.numoffiles@") < 1) {result.isPassed=false; result.addMsg('Please upload at least one file'); }
End date is before Start date -> Fail:
if (datediff('@date(startdate)@','@date(enddate)@','d') < 0) {result.addMsg('End date must be later than Start date')); result.isPassed=false; }
To include other scripts from SmartCheck script:
//@include(AnotherSmartCheckScriptName)