by
KK » Tue Jul 31, 2018 12:36 pm
Thanks. That makes things perfectly clear (nice graphic, BTW

).
OK, for dropdowns I am sure you know that a hyphen '-' can be used as a value that is considered as not-selected e.g. as in the following where selecting 'Please Select' wll not be considered a valid selection because its value is a hyphen -
- Code: Select all
opt_values='Please Select=- | Residential=0 | Commercial=1 | Rental=2'
If your dropdown containing user names does not have such a value, please add it to it.
Now, supposing the dropdown is named 'selected_user', we can slightly modify our original code to add a check for the dropdown as follows -
- Code: Select all
<cms:if frm_checkbox_checked ne 'Checked' && frm_selected_user ne '-' >
<cms:set frm_checkbox_checked = 'Checked' />
<cms:set my_send_mail = '1' />
<cms:else />
<cms:set my_send_mail = '0' />
</cms:if>
Effectively, an email would be sent only if *both* the conditions are set -
1. The 'Notification sent' checkbox is not checked
AND
2. A valid user is selected in the dropdown.
Hope this helps.