Jump to content

GoodBoy

Caspio Ninja
  • Posts

    95
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by GoodBoy

  1. On 11/17/2021 at 9:12 AM, GoodBoy said:

    Hello @Petra001, you might want to try this solution for the submission form.

     

    First, add an HTML block beside your listbox and paste this code. This will be the button link to clear all the options you select in the listbox.

    <a href="#" onclick="clearSelected();">Clear</a>

     

    Then, paste this code in your Footer. You may disregard the script tag if you already have a code in your Footer. FIELDNAME should be the name of your listbox.

    <script>
    
    function clearSelected(){
        var elements = document.getElementById("InsertRecordFIELDNAME").options;
    
        for(var i = 0; i < elements.length; i++){
          elements[i].selected = false;
        }
      }
      
    </script>

     

    I just use this article as reference for this solution: https://stackoverflow.com/questions/12802739/deselect-selected-options-in-select-menu-with-multiple-and-optgroups

    Here is a sample output as well: https://c0hcv332.caspio.com/dp/3b43900075840456488c405a9945 :)

    Additionally, if you would like to have a 'Select All' button, then it just has the same workflow as deselecting the options.

    Just add this below the first code in your HTML block.

    <a href="#" onclick="allSelected();">Select All</a>

     

    Then, insert this in your Footer as well.

    <script>
    function allSelected(){
        var elements = document.getElementById("InsertRecordFIELDNAME").options;
    
        for(var i = 0; i < elements.length; i++){
          elements[i].selected = true;
        }
      }
    </script>

     

    Just disregard the script tag if you already have it. Hope this helps!

  2. Additionally, if you are using an Update DataPage. You can just change the InsertRecordFIELDNAME to EditRecordFIELDNAME inside the Footer code. Like this:

    <script>
    function clearSelected(){
        var elements = document.getElementById("EditRecordFIELDNAME").options;
    
        for(var i = 0; i < elements.length; i++){
          elements[i].selected = false;
        }
      }
    </script>

     

  3. Hello @Petra001, you might want to try this solution for the submission form.

     

    First, add an HTML block beside your listbox and paste this code. This will be the button link to clear all the options you select in the listbox.

    <a href="#" onclick="clearSelected();">Clear</a>

     

    Then, paste this code in your Footer. You may disregard the script tag if you already have a code in your Footer. FIELDNAME should be the name of your listbox.

    <script>
    
    function clearSelected(){
        var elements = document.getElementById("InsertRecordFIELDNAME").options;
    
        for(var i = 0; i < elements.length; i++){
          elements[i].selected = false;
        }
      }
      
    </script>

     

    I just use this article as reference for this solution: https://stackoverflow.com/questions/12802739/deselect-selected-options-in-select-menu-with-multiple-and-optgroups

    Here is a sample output as well: https://c0hcv332.caspio.com/dp/3b43900075840456488c405a9945 :)

  4. Just to add, this workflow works well in standalone Details and Single Record Update DataPages. If you are using it in the Details page from a Results page, I'm afraid the code won't work. However, as a workaround, you may just need to separate the Results Page and Details page and create an HTML block inside the results page that includes the details page URL with the ID parameter on it to pass the data.

  5. Hello! You can just use this article to generate latitude and longitude for your existing records. Just modify the 'InsertRecordFieldName' lines into 'EditRecordFieldName'. Also, please make sure that the field name you used in the table is the same with the inputted in the code. If it is Zip in the table, then it should be Zip in the code as well.

    image.png.1312960052329c0d960ea1bcf4c0566f.png

  6. I believe this is possible by using some JavaScript. You may try the codes below.

     

    Header:

    <script src=https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js> </script>

    Footer:

    <script>
    $( "<div style='clear:both!important;'/></div><div style='page-break-after:always'></div><div style='clear:both!important;'/> </div>").insertBefore( ".cbResultSetGroup1Row:not(:first)" );
    </script>

     

    :)

×
×
  • Create New...