Changes

Jump to: navigation, search

SmartCheck Validation

335 bytes added, 14:55, 7 December 2015
no edit summary
=Examples=
====Application Name field black -> Fail:====
<pre>if(form.getStr("sf_Application Name") == "")
{result.isPassed=false;
}</pre>
====Requested Amount less than X -> Fail:====
<pre>if(ssParseNum(form.getStr("cf_Requested Amount")) < "5000")
{result.isPassed=false;
}</pre>
====Number value greater than 5 -> Fail:====
<pre>if(ssParseNum(form.getStr("cf_Store Value")) > 5)
{result.isPassed=false;
</pre>
====Single field upload field has no file -> Fail:====
<pre>if("@Single File Field.filename@" == "")
{result.isPassed=false;
</pre>
====Multi file upload field has no files -> Fail:====
<pre>if(ssParseNum("@level1.MUlti upload.numoffiles@") < 1)
{result.isPassed=false;
result.addMsg('Please upload at least one file'); }
</pre>
 
 
===Comparing two custom date fields with separate custom time fields storing 24 hour time===
<pre>if(form.getStr("cf_Event Start Date")+' '+form.getStr("cf_Event Start Time") >= form.getStr("cf_Event End Date")+' '+form.getStr("cf_Event End Time"))
{result.isPassed=false;
result.addMsg('cf_@Event End Time.id@','End Time must take place after the Start Time'); }
</pre>
 
====To include other scripts from SmartCheck script:====
2,004
edits

Navigation menu