Jump to content

roattw

Caspio Guru
  • Posts

    204
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by roattw

  1. No problem.  Appreciate any help. 

    Im trying to count from the field CME_category.  Grouping and Aggregate doesn't do the best job of counting individual entries or placing them in an easy to see stacked view like Im trying to achieve.  As these categories grow and the number entries get huge grouping and aggregate numbers will get spread out and some off screen as the entries grow.  A simple report tally in one spot will be helpful and more useful and easily digestible to me users.  The one above should read.  I only included 3 categories for test.

    summary
    cardiology = 3
    critical care = 2
    EM = 2
    Medicine = 1
     
    stroke = 1 
    trauma = 1 

    I dont have editable turned on as I want it to be just a visual summary report, non editable.  Hope that makes sense.

  2. Thanks for the reply!  Probably not the best example as I dont need a button href link to cause anything.  I just need an HTML importan tnote field to appear (HTML block) is a value is selected.  The suggested code had an effect, it didnt show the red important note field at all so close.

    Currently it looks like this.  *24-hour clock shows all the time (HTML block), need selective appearance.

    LSN.jpg.603883edf7dc7e28bb8b1b2941933ce5.jpg

    If  SPECIFIC selected here a field for "Specific LSN time" appears.  That's where we need the reminder to use 24 hour clock. Doesn't need to be there until then.:

    Lsn2.jpg.5693f2446fd85d6ded31565cac01b342.jpg

    The code had effect when placed in the HTML field, it prevented the block from appearing at all regardless of "Specific selection".

    lsn1.jpg.4fc0877a7dea0390fad83957da1265a8.jpg

    Lsn4.jpg.805f38d469664bf3a5b7871d50231b47.jpg

    Still no Red Note HTML text.

    Not sure if that HREF button or other call is needed to make run the change.  This one needs to just be on select.  In your example does the <P> ID uniqueParagraph need to to match of be noted somewhere else?

    Lsn3.jpg

  3. Have a basic form field, drop down, 3 options to select one of:

    Form field "CME_Category": choices  stroke, cardiology, trauma

    I just want to count number of occurrences of each of those three selection options (stroke, cardiology, trauma) and have them appear in the datapage report.  A basic COUNTIF function in Excel.

    Im using this code I saw in action for a Yes/No field example, but cant get it to work within this situation.  Is it not happy with JQuery?

    This is in FOOTER. Although I have split it in Header, Footer, HTML block etc and still doesnt work.  Im just guessing now ;^)  The DIV of course appears but it doesnt count.
     

    <script type="text/javascript">
    $('[@field:CME_Category]').change(function() {
        // get all selects
        var allSelects = $(CME_Category');
    
        // set values count by type
        var Stroke = 0;
        var Trauma = 0;
        var Cardiology = 0;
        
        // for each select increase count
        $.each(allSelects, function(i, s) {
            // increase count
            if($(s).val() == 'Stroke') { Stroke++; }
            if($(s).val() == 'Trauma') { Trauma++; }
            if($(s).val() == 'Cardiology') { Cardiology++; }
        });
    
        
        // update count values summary
        $('.cnt-Stroke').text(Stroke);
        $('.cnt-Trauma').text(Trauma);
        $('.cnt-Cardiology').text(Cardiology);
    });
    </script>
    
    <div id="CME_Category">
        summary<br>
        stroke  = <span class="cnt-stroke">0</span> <br>
        trauma  = <span class="cnt-trauma">0</span> <br>
        cardiology  = <span class="cnt-cardiology">0</span> <br>
    </div>

    Need these to show 2 and 1 for Cardiology and Stroke respectively.

     

    2017-10-17_14-20-59.jpg

  4. Old post, but can you clarify?  When I create a list report of the values I dont see an option to hide.

    If I have a basic form with basic dropdown and I just want to tally number of times each option was chosen, would this work?

    Example dropdown field:

    Favorite Alcoholic Beverage:  Wine, Beer, Mixed drinks

    Over time just want to know how many chose Wine, how many chose Beer, etc.

     

    Would it code like this:

    HEADER:     <script type="text/javascript">var countWine=0;var countBeer=0;var countMixed=0;</script>

    FOOTER:

    <script type="text/javascript">

    document.write(count);
    </script>
     
     
  5. Thanks Douvage

    With my fledgling JS skills I have a question.  The example with showing/hiding images makes sense, but what is the function to show nothing?  Im my case if a field (LSN_time) contains the a specific radial button choice (Specific), then show HTML Block 2.  Other wise hide it.  This isnt working, presumably because of incorrect naming of the HTML Block.

     

    <div id="LSNTime"></div>
    <script>
    var linkDiv = document.getElementById("LSNTime");
    var  = 'HTML Block 2';

    if('[@LSN_time]' == 'Specific'){
    linkDiv.innerHTML = HTML Block 2;
    } else {
    linkDiv.innerHTML = none;
    }
    </script>

  6. Reporting: simply counting the number of times the choices in a drop down were selected? I have several drop downs on a form. I just need to tally the number of times each of the drop down choices was selected. Cant seem to just get a simple count of each dropdown choice.  In excel its a simple countif= fucntion.  Kinda surprised a robust system like caspio cant do it out of box.

    Example: Form data page question asks people Whats Your Type of Music? Drop down options Rock, Jazz, Hip Hop, Classical. After 6 months I need to tally the number of people that chose Rock, Jazz, Hip Hop or Classical. It would be a very basic Excel countif= function.

  7. I want to include an HTML reminder text on a form when a specific field on a form is a certain value.  Hint/Tip not what I want since its hidden unless licked.  I want some RED text to appear is form field = X.  I can get the text to display on form with HTML block.  But using Rule Conditions I cant choose to hide the HTML block, only actual fields.

    Way to apply rule/condition to an HTML block?

  8. Hiding Multiple Login Forms: http://howto.caspio.com/tech-tips-and-articles/common-customizations/hiding-multiple-login-forms/?_ga=2.107921729.2102379586.1507150279-2116692682.1507150279

    Guide says to this in the HEADER of the Authentication:

    <div name="cb-auth-box">

    And this in the Footer:

    </div>

    The problem is that in SOURCE view to enter <div name="cb-auth-box"> the second you switch out of SOURCE view or SAVE it adds the closing </div>. So when you got bak it shows <div name="cb-auth-box"></div>

    For the Footer </div> it simply removes it altogether, presumably adding it to the footer to close that <div> tag.

  9. I have a basic app with only one group of authenticated users (no roles) achieved thru registration.  User registers, logs in, then can enter some data using a basic form.  OVer time they will add more records via the form and only see their records.

    Only two tables: Registered users and a Form Data.  One authentication.  No authentication table.

    Im trying to combine two datapages emdeded on one webpage - one form and one report so that on one page the user could see the summary report of their current data and also submit another entry. See below:

    5990dfcd40243_image1.thumb.png.b5d31ea26131e70f173a70033656dd9b.png

    Works well, but because they are both set for record level access when I choose LOGOUT both sections show a login box.  

    image2.png.bf801e13e9182806573843e859b1f005.png

    Would like logoff to go to one page to log back in.  tried to create a static Login Page with redirect but it wouldnt work. I tried a View but couldn't get it to work. 

    Followed many of the how to's but since this one is simple (no roles) none of the examples quite apply.  All input welcome.

     

     

  10. Hoping you can point me in right direction.  Im struggling on something simple.

    Need users to register.
    Once registered they make an ENTRY to their profile/account: 

    CMEType: multiple choice    |   CMEHours: number   |   Upload: upload file   |   SUBMIT

    They can enter as many submissions as they wish which will build in a table.  Im having trouble getting a logged in user to see only their entries once logged in and for the main table to distinguish between users.

    Table1:
    RecordID: autonumber/unique
    Name
    Email: username
    Password: Password

    \Registration works fine but having trouble tying a new submission to thier account.  

  11. Hopefully I can explain this.

    Three Fields: 

    A= Yes/No

    B= Dropdown choice with an "other" option

    C = Other field if OTHER chosen in dropdown B.

    If A = No, hide B and C

    Having trouble getting B and C to appear/hide based on values because I think you can only use a rule on one field at  a time.

    Example:

    A = Male? (Y/N) , if Yes show B, keep C hidden still.

    B = Dropdown with "other" option.  If other chosen, then show C, the other text field.

    But the rule stating to hide B and C does not allow me to apply another Rule for C.  I can get B and C hidden or shown at same time only.  Hope that makes sense.

    Way around this?

     

  12. I might be over thinking this, as usual.  I would like to create a dashboard page where the user can click a button and run a static commonly requested report,  This page would contain 10 or so of the most commonly requested on reports.  People would just visit the page, click a report icon, be shown the results, and be done - without having to search, sort, or use other results page functions.

    Is this a built in option, or is really just a graphic button hyperlinked to a webpage that contains the embedded Caspio report datapage code?  Is there a better cooler way?  ;^)

  13. Mylene.  This is working with one exception.  

    Works great but wont work on two other text fields setup the same way. The only thing different is that the two fields where it doesn't work are fields that Show/Hide based on a Rule. Wondering if that Rule status is preventing the field name to be recognized by the script?


    <script>

    function isNumberKey(evt){
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;
    return true;
    }
    document.getElementById('InsertDTN_time').onkeypress =isNumberKey;
    </script>

  14. I have a script to limit field characters to numbers only.  Works great on computer/html but not on Smartphones.  

    <script>

    function isNumberKey(evt){
        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
        return true;
    }
    document.getElementById('InsertRecordTIME2').onkeypress =isNumberKey;
    </script>

     

    Do smart phones use an entirely different set of event handlers or script?  Is it the .onkeypress or something more intense?

  15. I have a script forcing numeric characters only in a couple fields (thanks May Music).  

    <script>

    function isNumberKey(evt){
        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
        return true;
    }
    document.getElementById('InsertRecordFIELD1').onkeypress =isNumberKey;
    </script>

     

    I had several fields like this so I cheated and created one script for each FIELDNAME (I know, I know, Im still learning  :^).  How could I combine all fields into that one script above?  I tried this but it didnt work:

    document.getElementById('InsertRecordFIELD1','InsertRecordFIELD2','InsertRecordFIELD3')

     

×
×
  • Create New...