winsteadc Posted April 11, 2011 Report Share Posted April 11, 2011 Hi! I am new here and new to Java as well, and I am having ussues already. I got the Java for multi-select list boxes, and put it in my HTML header but it does not work...any help would be greatly appreciated. I need 3 of the list boxes I have on my submission form to be multi-select. The first Field is "Hardware", so is this what I need to type? SCRIPT LANGUAGE="JavaScript"> /* "fieldName" is the variable name for the listbox type form element field. */ var fieldName = "InsertRecordHardware"; var x=document.getElementsByName(fieldName); x[0].multiple=true; Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted April 11, 2011 Report Share Posted April 11, 2011 Hi, The code should go to an HTML block at the bottom of the DataPage elements. So insert an HTML Block using the "Insert" button, http://howto.caspio.com/datapages/form- ... locks.html, and then move the block all the way to the end of the elements using the Up/Down button and place the code in the block. Best, Bahar M. Quote Link to comment Share on other sites More sharing options...
winsteadc Posted April 11, 2011 Author Report Share Posted April 11, 2011 Thank you! That fixed it. So, now if i want more than one field to be Multi-Select, do I have to do the whole code again, or just the "var fieldName = "InsertRecordHardware";" part? Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted April 12, 2011 Report Share Posted April 12, 2011 Let's say you have three fields (FIELDNAME1, FIELDNAME2, and FIELDNAME3) and you want to enable multi-select listbox for all three fields, here is the code sample you can use. PS: make sure to replace the FIELDNAME1, FIELDNAME2, and FIELDNAME3 with your table field names. /* "name1" is the variable name for the listbox type form element field. */ var name1 = "InsertRecordFIELDNAME1"; var name2 = "InsertRecordFIELDNAME2"; var name3 = "InsertRecordFIELDNAME3"; var x=document.getElementsByName(name1); x[0].multiple=true; var y=document.getElementsByName(name2); y[0].multiple=true;' var z=document.getElementsByName(name3); z[0].multiple=true; Quote Link to comment Share on other sites More sharing options...
winsteadc Posted April 12, 2011 Author Report Share Posted April 12, 2011 Thanks for the reply. I went ahead and did the script 3 times, and that worked as well. I may go back and change it when I have everything else working the way I want it. Quote Link to comment Share on other sites More sharing options...
shroyer Posted June 17, 2014 Report Share Posted June 17, 2014 I am new to Caspio and this forum. I would like to know if I can limit the number of selections that a person can make in a multi-select submit form based on the level of their subscription to my service. A Basic user might be able to select only 3 items in the Listbox while a higher level subscriber can select 5. Is this possible? As the user upgrades their subscription level can I dynamically change this limitation? Thanks Bob 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.