Jump to content

Show selected values from listbox


Recommended Posts

Use the code below :

 

<SCRIPT LANGUAGE="JavaScript">
var field= "InsertRecordFIELDNAME"; 
   var x=document.getElementsByName(field);
   x[0].multiple=true;

document.getElementById("Submit").onmouseover= function(){
var l = document.getElementById(field); 

for (var i = 0; i <  l.options.length; i++) {
     if(l.options[i].selected == true){

      var   o = o + "," +l.options[i].value; 
}
      
  }
document.getElementById('cbParamVirtual1').value = o.substring('undefined,'.length);
}

</SCRIPT>

in "InsertRecordFIELDNAME" replace  FIELDNAME to the listbox field name. And also "cbParamVirtual1" is the ID of Virtual 1. This code will trigger on hovering over submit button. 

 

To fire the code when selection is done you can change

document.getElementById("Submit").onmouseover

to

document.getElementById(field).onblur

 

Link to comment
Share on other sites

  • 2 years later...

Hi @Master,

As of July 12, 2018, Caspio introduced new features which you can find here: https://howto.caspio.com/release-notes/caspio-bridge-13-0/

This release includes a new feature, Calculated Values in Submission Forms.  You can use this to your Virtual Field to get the value of your Listbox. 

Check these videos for more information:

 

I 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...
 Share

×
×
  • Create New...