Master Posted July 21, 2016 Report Share Posted July 21, 2016 How can I have a listbox in which user can select more than one name to send email to? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 21, 2016 Report Share Posted July 21, 2016 Emails values need to be combined separated by ";". Add a listbox to your submission page, for Display select name and for Value select email. There needs to be another field which is saving the combined email values. It can be a virtual field. Use the code below in Footer of the page <script type="text/javascript"> var o_els = new Array("LISTBOX FIELD ID"); for (var j=0;j<o_els.length;j++){ var fieldName = o_els[j]; var x1=document.getElementsByName(fieldName); x1[0].multiple=true; } function splitAndParse() { var o_els = new Array("LISTBOX FIELD ID"); var v_result = new Array("SENT TO EMAIL FIELD"); var result = ""; var cleanResult = ""; for (var k=0;k<o_els.length;k++){ result = ""; var fieldName = o_els[k]; var y1=document.getElementsByName(fieldName); for (var i = 0; i < y1[0].length; i++) { if (y1[0].options[i].selected) { result += y1[0].options[i].value+ " ; " ; } } if (result.length > 2) { cleanResult = result.substring(0,(result.length-2)); } document.getElementById("SENT TO EMAIL FIELD").value= cleanResult; } } document.getElementById("Submit").onmouseover=splitAndParse; </script> replace the IDs in the code above with appropriate IDs also make sure email field is not display only. This field can be used to send email to. Quote Link to comment Share on other sites More sharing options...
Ashfak Posted September 8, 2016 Report Share Posted September 8, 2016 What could be the syntax for replacing LIST BOX FIELD ID With desired value. For example: "Email" field in submission form. Quote Link to comment Share on other sites More sharing options...
kR013 Posted September 14, 2016 Report Share Posted September 14, 2016 @Ashfak, you can use your browser's Developer Tool and/or FireBug to determine the exact ID of your form element. You may also refer to Caspio's Guide with regard to form elements http://forums.caspio.com/index.php?/topic/4377-js-guide-caspio-form-elements/ Quote Link to comment Share on other sites More sharing options...
Ashfak Posted September 15, 2016 Report Share Posted September 15, 2016 Hi KR013, Thank you for the reference. It worked -Ashfak Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 22, 2016 Report Share Posted September 22, 2016 In a Submission page it is InsertRecordFieldName, update/details page EditRecordFieldName Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.