Changes

JavaScript Validation

108 bytes added, 20:55, 12 March 2014
no edit summary
When using this method, ensure that "Allow Empty" is selected for this field.
==To make a check box [[Check Boxes]] field conditionally mandatory==
If there is a check box field under a show hide header [[showhideheader]] and you wish to make this check box field mandatory ''only if'' the value '''Yes''' is selected from a dropdown [[Combo Box]] field, Paste use the JavaScript below in the [[JavaScript Validation field ]] on the "Select Many - [[Check Boxes" ]] custom field type:<br />
'''isChkSelected(frm.cf_''fieldid'') || frm.cf_''fieldid''.value!="Yes":<br />'''
in the JavaScript validation syntax where<br />
1) isChkSelected(frm.cf_''fieldid'')= this (frm.cf_''fieldid'') is the field id of the check box field to be made conditionally mandatory.<br />
2) frm.cf_''fieldid''.value= this cf_''fieldid'' is the [[Custom Field ID|custom field ID]] of the dropdown field.<br />
For example:In the JavaScript validation syntax where<br />A combo :1) '''isChkSelected(frm.cf_''fieldid'')''': this (frm.cf_''fieldid'') is the field id of the check box field- Did your organization receive any non-monetary assistance? (1387274) to be made conditionally mandatory.<br />Options are Yes;No;:2) '''frm.cf_''fieldid''.value''': this (frm.cf_''fieldid'') is the [[Custom Field ID|custom field ID]] of the [[Combo Box]] field that controls the visibility of the Check Boxes field.<br />If yes is selected than they should answer a mandatory check box field. Non Monetary Assistance check box (1378251).
Put this JavaScript in JavaScript Validation on check For example:* A combo box field:<br /> Did your organization receive any financial assistance? (custom field id 545454): * Options are Yes;No;
If yes is selected than they should answer a mandatory check box field. '''Which of the following types of financial assistance''' (custom field id 989898). Include the following JavaScript Validation on the check box field: isChkSelected(frm.cf_1378251cf_989898) || frm.cf_1387274cf_545454.value!="Yes"
 
 
When using this method, ensure that "Allow Empty" is selected for this field.
0
edits