Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/26/2016 in all areas

  1. 1 point
    I'm trying to create a form submission data page where the user can select multiple age ranges, for instance, "Ages 12 and Under" AND "Ages 18 and Over." I found the following page in the Caspio Help area: http://howto.caspio.com/datapages/form-elements/dropdowns-and-listboxes/multi-select-list-boxes-in-search-forms.html The picture shows an option to "allow multi-select" with list boxes, but when I go to my own Web Form Wizard, I don't see that option. Has Caspio disabled/deleted that option? If so, it's rather irritating that the online help documentation hasn't been updated to reflect the change. I've just wasted quite a bit of time trying to find the "allow multi-select" option only to to come to the conclusion that it probably doesn't exist anymore, even though the screenshot in the Help area clearly shows it. :-( Is anyone else able to access the "allow multi-select" option with list boxes when creating/editing a form submission data page? Am I looking in the wrong place? Or is Caspio simply behind in updating their documentation? Thanks in advance!
  2. 1 point
    <input id="klant" class="cbSubmitButton" type="button" value="klant" name="klant" onClick="window.location.href='[@app:your app page]'"> maybe this will help , regards peter
  3. 1 point
    Jan

    Js: Checkboxes For Multi-Optioned Entries

    Hello IPV, Welcome to Caspio forum! If I understand correctly, you have one field that stores values. So, you can Select the Hidden FormElement for the field that stores values. Add a Virtual field, select the "Checkbox" element and enter your values, for example, "Math", to "Display Text" and "Value when checked" fields. Add as many virtual fields as you want. Add Header&Footer element, select the Footer element, click the Source button and enter the following script: (please enter the name of your field that stores values instead of "text"; enter the numbers of first and last Virtual fields in the group of checkboxes, in my case the first one is VirtualField1 and the last one is VirtualField3) <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Resultfieldname = "text"; var firstVirtual = 1; var lastVirtual = 3; var ResultString = ""; var virtualFieldName = ""; for (i=firstVirtual ;i<=lastVirtual; i++) { virtualFieldName = "cbParamVirtual"+i; if (document.getElementById(virtualFieldName).checked) ResultString = ResultString + "," + document.getElementById(virtualFieldName).value; } Resultfieldname = "InsertRecord"+Resultfieldname; if (ResultString.length>0) ResultString = ResultString.substr(1); document.getElementById(Resultfieldname ).value = ResultString; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> If you have more than one block, you can add blocks like: (please enter the name of your second field that stores values instead of "new"; enter the numbers of first and last Virtual fields in the second group of checkboxes, in my case the first one is VirtualField4 and the last one is VirtualField6) Resultfieldname = "new"; firstVirtual = 4; lastVirtual = 6; ResultString = ""; virtualFieldName = ""; for (i=firstVirtual ;i<=lastVirtual; i++) { virtualFieldName = "cbParamVirtual"+i; if (document.getElementById(virtualFieldName).checked) ResultString = ResultString + "," + document.getElementById(virtualFieldName).value; } Resultfieldname = "InsertRecord"+Resultfieldname; if (ResultString.length>0) ResultString = ResultString.substr(1); document.getElementById(Resultfieldname ).value = ResultString; Then the whole script will be like: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Resultfieldname = "text"; var firstVirtual = 1; var lastVirtual = 3; var ResultString = ""; var virtualFieldName = ""; for (i=firstVirtual ;i<=lastVirtual; i++) { virtualFieldName = "cbParamVirtual"+i; if (document.getElementById(virtualFieldName).checked) ResultString = ResultString + "," + document.getElementById(virtualFieldName).value; } Resultfieldname = "InsertRecord"+Resultfieldname; if (ResultString.length>0) ResultString = ResultString.substr(1); document.getElementById(Resultfieldname ).value = ResultString; //second block Resultfieldname = "new"; firstVirtual = 4; lastVirtual = 6; ResultString = ""; virtualFieldName = ""; for (i=firstVirtual ;i<=lastVirtual; i++) { virtualFieldName = "cbParamVirtual"+i; if (document.getElementById(virtualFieldName).checked) ResultString = ResultString + "," + document.getElementById(virtualFieldName).value; } Resultfieldname = "InsertRecord"+Resultfieldname; if (ResultString.length>0) ResultString = ResultString.substr(1); document.getElementById(Resultfieldname ).value = ResultString; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> I hope, it helps. Please feel free to ask if anything is unclear.
  4. 1 point
    In my case, I was OK with using a dropdown menu for data entry, as the selection would only be temporary or permanent. (The item could never be both). But in the search page, a user may want to search for either or both, and checkboxes would be much more user friendly. In Configure Search Fields select the DataPage Element, and make it a listbox with comparison type of equal. Make the source a lookup and select the table. Create a new HTML Block under that Element, and paste the following: <label>Permanent</label> <input type="checkbox" id="checkbox0" onClick="changeSelect('0')"> <label>Temporary</label> <input type="checkbox" id="checkbox1" onClick="changeSelect('1')"> You can easily add to this if your input listbox contained something like "semi-permanent". Below the HTML Block, create a new Footer, and paste the following: <script type="text/javascript"> var pushVal = document.getElementById('Value5_1'); pushVal.style.display = "none"; function changeSelect(value) { var box0State = document.getElementById('checkbox0').checked; var box1State = document.getElementById('checkbox1').checked; if (value == 0 && box0State == true || value == 1 && box1State == true) { pushVal[value].selected = true; }else{ pushVal[value].selected = false; } } </script> This is pretty easy to extend as well. If you added a checkbox with id of 'checkbox2' in the HTML, just write a new var box2State line, add " || value == 2 && box2State == true" to the if statement and you're done. Note in the above code that the id of my listbox is Value5_1, which I'm hiding from the user and also populating its values through the checkbox handlers. You will need to change that id to the id Caspio Bridge assigns to your particular element. Maybe this will keep someone out there from a few hours of head scratching.
×
×
  • Create New...