FreePnyx Posted March 16, 2015 Report Share Posted March 16, 2015 Is there a way to create a form field that allows more than one answer to be chosen from multiple choices listed either as radio buttons, a drop down menu, or a list box? Quote Link to comment Share on other sites More sharing options...
Jan Posted March 19, 2015 Report Share Posted March 19, 2015 Hello FreePnyx, Welcome to forum! You can create a ListBox with multiple choices. On Search Page you can open the Advanced tab and check the corresponding checkbox. On Submission Form you can use the Java Script code. On Single Update Form (and Details page) you can use another Java Script code. FreePnyx and lmooring 2 Quote Link to comment Share on other sites More sharing options...
FreePnyx Posted March 20, 2015 Author Report Share Posted March 20, 2015 Thanks, Jan. The Search page solution worked fine, but I couldn't find the HTML footer to enter the Java Script code for the Submission Form solution. All I could find were the HTML block, or the header and footer. Quote Link to comment Share on other sites More sharing options...
Jan Posted March 20, 2015 Report Share Posted March 20, 2015 Hello FreePnyx, It is the Footer element. Please do not forget the clicking the "Source" button, when you enter a Java Script code to a Footer or to an HTML Block. Quote Link to comment Share on other sites More sharing options...
aam82 Posted March 25, 2015 Report Share Posted March 25, 2015 Hi, if using the multiple answers javascript for a submission form, is the content of such an entry searchable with AND/OR statements? Such as, "Nebraska AND Washington" Thanks Quote Link to comment Share on other sites More sharing options...
Jan Posted March 31, 2015 Report Share Posted March 31, 2015 Hello aam82, When you submit multiple answers, they are stored in the field and they are separated by comma. For example: "Nebraska, Washington" On the Search Page, on the Advanced tab for Listbox elements, there is the "Allow multi-select" checkbox with two options: Match any (OR) Match all (AND) The second one is disabled, if "Equal" comparison type is selected on the Standard tab. You can select "Contains" Comparison type, then both options are enabled. If you want more complex logic, you can use Criteria, "Contains" Comparison type and Logic tab. I hope, it helps. Quote Link to comment Share on other sites More sharing options...
DMart Posted May 16, 2015 Report Share Posted May 16, 2015 Hi Jan- I've created a multi-select listbox in a Submission form using Java Script code (similar to what you suggested above) and I've been trying to figure out how to make the match an "OR" operator, but I haven't had much luck. As it says here, Submission forms don't have multi-select option as a standard feature, so then I'm not presented with a simple option for how the match works. Also, it doesn't look like I have a logic tab available in this instance. Do you have any suggestions for how to make it an OR relationship between these multiple selects? [if it helps, from the user perspective, I'm using this in an "advance search" form for my database.] Thank you! DM Quote Link to comment Share on other sites More sharing options...
Jan Posted May 18, 2015 Report Share Posted May 18, 2015 Hi DM, If I understand your question correctly, there is the post on the forum with instructions. I hope, it helps. DMart 1 Quote Link to comment Share on other sites More sharing options...
DMart Posted May 18, 2015 Report Share Posted May 18, 2015 Aha! You are a forum search master, thank you! Quote Link to comment Share on other sites More sharing options...
TWIRED Posted November 26, 2016 Report Share Posted November 26, 2016 Thsi is driving me crazy - Im not really a javascript programmer (Thats why i chose caspio) Ive been trying to create a simple multi select listbox , all the code links you guys submitted go to unavailable links like below. I have a simple text field in my db "AirHotelCars" , 1)I added 1 script I found to the footer 2) What are the exact step-by-step settings for the db field "AirHotelCars" field in "Configure fields" * some people mentioned make it Hidden ,what are the exact on load and exit settings for the "AirHotelCars" field? 3) I created a virtual field and modified the footer javascript. * some people mentioned make it Hidden ,what are the exact on load and exit settings for the Virtual1 field? Its not working and Ive spennt 2 days trying to figure this out. I cant believe Caspio does not have a simple solution for multiple select listboxes and check boxes. Thats as basic as it gets. Grrr Any help would be appreciated ! " The page you requested does not exist Quote Link to comment Share on other sites More sharing options...
TWIRED Posted November 26, 2016 Report Share Posted November 26, 2016 STEP BY STEP HOW-TO MULTIPLE SELECT CHOICES IN LISTBOX ON UPDATE , DETAILS OR UPDATE REPORTS PAGES. ------------------------------------------------------------------------------------------------------------------------------------------ Make Changes in the script below --------------------------------------------------------------------------- Change mydbfieldname to whatever your database Field Name is Append “EditRecord” with whatever your database fieldname is Example : Change “EditRecordmydbfieldname” to “EditRecordyourfieldname” in the script. Paste the modified code below in the HTML Footer Section (Click on “Source” ) ------------------------------------------------------------------------------------------------------------------------------ Footer is available in the “Configure Details Page Fields” Section in DataPage using the Caspio Bridge DataPage Wizard. C) Configure your Field / Element ------------------------------------------------ Add your database field to the details page (in my example its “mydbnamefield” ) Change the element (mydbnamefield” Form Element to Listbox (In standard section > General Options) Choose Custom Values in Source Enter your Custom Values . Example : Air, Hotel , Cars In Advanced Section , SELECT “on exit” : Pass field value as parameter Enter [@mydbnamefield] as value or whatever your database field name is. Thats it ! Viola ! . Now you will be able to multiple select the values in the listbox on your page using Control +Click The Values will be stored in your database field name like this…. “Air,Hotel,Cars” as a string. This script below can be used (“As-Is”) SCRIPT FOR MULTIPLE SELECT CHOICES IN LISTBOX ON UPDATE , DETAILS OR UPDATE REPORTS PAGES. ----------------------------------------------------------------------------------------------------------------------------------------------------- <script type="text/javascript">var v_state = "[@field:mydbfieldname]" ;var o_state = document.getElementById("EditRecordmydbfieldname") ;o_state.multiple = true ;function f_listbox() { if ( v_state.indexOf(",") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) {if(o_state[i].value == v_state) {o_state.remove(i);break ;} } var o_st = v_state.split(", ") ; for (var j=0 ; j < o_st.length; j++) {for (var i=0 ; i < o_state.options.length; i++ ) {if(o_st[j]== o_state.options[i].value){ o_state.options[i].selected = true ; break ;} } } }} window.onload = f_listbox ;</script> 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.