Jump to content

ListBox Field - Get selected values and insert to another field in Submission Form


Recommended Posts

Hi Altair you can try this code to iterate though the selected list and append to each field:

Here's my table:

image.png.494c074e2592e92b1d91d15e2f742ea5.png
 

Here's the code to be added in the Footer:

<SCRIPT>

document.addEventListener('DataPageReady', assignMultiple);
function assignMultiple() {
   /* You can modify the element ID as needed for x and y via Inspect Element/F12 */
   let x=document.getElementById('cbParamVirtual1');
   x.multiple=true;
   x.addEventListener("click", function() { 
     /* You can modify the element ID as needed for y */
     let y =document.getElementById('InsertRecordMulti_Email_Input');  
     y.value ="";
     
     var listLength = x.options.length;
     for(var i=0;i<listLength;i++){
       if(x.options[i].selected)          
           y.value = x.options[i].value + ";" + y.value;
        }     
});
  
} 
</SCRIPT>

Sample output:
image.png.02dfb3e55cf23d29b000ec15e72f62fc.png

Hope this helps!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...