Dynamic population of select box with none and that should show as mandatory

sushmachava
Tera Contributor

i have preserver email option in the form, when i select that as false a new group email field is getting populated. and there is a dynamic list of choices that will autogenerate email based on the new group name  user has given

 

i have written an on change client script for new group name feild based on that email will be populating i have added none option in the selectbox not to autopopulate any email. but the email feild is mandatory due to this form is thinking that it already has value as none and mondatory is getting greyed out i want that mandatory should be there if they select none it should show as mandatory for the user. how can i acheive this

 

these are the lines i have used in onchange script:

 

 

g_form.setMandatory('rgm_new_group_email', true);

            g_form.clearOptions('rgm_new_group_email');

            for (var i = 0; i < emails.length; i++) {
                g_form.addOption('rgm_new_group_email', '-- None --','-- None --');
                g_form.addOption('rgm_new_group_email', emails[i], emails[i]);
            }
0 REPLIES 0