Difference between revisions of "Change Checkbox Value Script"

From AgileApps Support Wiki
imported>Evelyn
(New page: Change the value of a checkbox field to <tt>True</tt> based on an integer meeting some criteria. <pre> if(form.contract_amount.value > 100000) { form.approved_for_loan.checked = true...)
 
imported>Aeric
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Change the value of a checkbox field to <tt>True</tt> based on an integer meeting some criteria.
Change the value of a checkbox field to <tt>true</tt> when the request amount is large enough.
 
:<syntaxhighlight lang="javascript" enclose="div">
<pre>
if(_sdForm[0].request_amount.value > 10000) {
if(form.contract_amount.value > 100000)
    setCheckboxState(_sdForm, "approval_required", true);
{
    form.approved_for_loan.checked = true;
}
}
</pre>
</syntaxhighlight>

Latest revision as of 08:31, 12 December 2016

Change the value of a checkbox field to true when the request amount is large enough.

if(_sdForm[0].request_amount.value > 10000) {
    setCheckboxState(_sdForm, "approval_required", true);
}