Jump to content

roattw

Caspio Guru
  • Content Count

    192
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by roattw

  1. In excel if I wanted to know the number of Year and months and days until something I would use: =DATEDIF(B2,TODAY(),"y") & " Years, " & DATEDIF(B2,TODAY(),"ym") & " Months, " & DATEDIF(B2,TODAY(),"md") & " Days" In CB calculated fields I can get one of the intervals - year OR month OR day but not all three using: Datediff(day,GetUTCDate(),[@field:ExpirationDate]) Can I convert that excel datediff to a CB friendly alrternative?
  2. Never had a company not do it overnight. Odd.
  3. This has been asked before but the answer didnt work. I have a Lookup table being called in a Datapage. I want one of the table choices to be the default. It work fine using Custon Lookup table and not using the table. Previous posts said add this to footer: <script type="text/javascript"> function f_default(){ document.getElementById("FieldName").value = "TheDefualtVaule"; } window.onload = f_default; </script> I have done this, referencing the correct field name and value but it doesn't work. Thoughts? Thanks as always.
  4. Followed the instructions. https://howto.caspio.com/tech-tips-and-articles/common-customizations/hiding-multiple-login-forms/ It does work, but when the page first loads you see a brief flash of ALL the login screens then they disappear. Anything change with this code/suggestion for modern CSS or HTML to cause this behavior? See attached screenshot video. Watch bottom of screen - they flash by. 2018-01-24_15-43-48.mp4
  5. Thanks Franchiser. Good tips! Will try them out. A lot of people have pop up blockers on so that may be an issue. How to all the Caspio example videos get it to appear within the page location where logout was chosen?
  6. Tables seem to show in oldest to newest sort order. Can that be switched to newest first in the table? Could do a data report page for that but would be easier to just do so in table view.
  7. My password reset link works fine but it opens in its own page: https://XXXXXXXXXXXX.caspio.com/dp.asp?AppKey=3f2d4000cc693c7fe3d0473c836f&cbpr......... And this page is outside the site and all its design. Can I have the reset link open as an embedded code within a section on my site? The login and forgot password shows up nicely embeded on my site. But Forgot Password target goes to its own URL upper right. Would love password reset form to show up in same spot as login.
  8. No luck. As usual, Caspio hates the syntax: count(case when [@field:CME_Category]<>0 then 1 else NULL end) and count(case when CME_Category <>0 then 1 else NULL end)
  9. A little closer, but it doesnt seem to tally correctly using select count('submission_id') from Submissions_CME where cme_category=target.[@field:CME_Category] GROUP BY [@field:CME_Category] I need to use a a COUNT () or COUNT (*) but CB hates that syntax. Also struggles with SQL WHERE statement. Its odd because this works: SELECT COUNT(*) FROM main_table SELECT COUNT(*) FROM main_table But fails if I add WHERE qualifier: SELECT COUNT(*) FROM main_table WHERE type_of_rock = jazz; I might try switching to getting some calculated field in the footer that would total counts of drop down selections: Type of Music Tallies: Rock = 10 Jazz = 2 Country = 4 Hip Hop = 1 Got really close with this but it wont tally, but does <script type="text/javascript"> $('[@field:type_of_music]').change(function() { // get all selects var allSelects = $(type_of_music'); // set values count by type var Rock = 0; var Jazz = 0; var HipHop = 0; // for each select increase count $.each(allSelects, function(i, s) { // increase count if($(s).val() == 'Rock') { Rock++; } if($(s).val() == 'Jazz') { Jazz++; } if($(s).val() == 'HipHop) {HipHop++; } }); // update count values summary $('.cnt-Rock').text(Rock); $('.cnt-Jazz').text(Jazz); $('.cnt-HipHop').text(HipHop); }); </script> <div id="type_of_music"> summary<br> Rock = <span class="cnt-Rock">0</span> <br> Jazz = <span class="cnt-Jazz">0</span> <br> HipHop = <span class="cnt-HipHop">0</span> <br> </div>
  10. In an attempt to simply tally the different choices made from a dropdown box people have suggested I use a SQL count in a calculated field. But no matter what formula I type Verify gives a syntax error and is not happy with a "(" with error: Incorrect syntax near (. Formula is select count(user_id) from table_name where [@field:CME_Category]='Value' All attempt and variations result in a syntax error. Think Im missing something basic about SQL format ina Caspio calculated field, naturally.
  11. Thanks Mathilda. Will try it out and report back. Would there be a slight alteration to that to not define each option but to instead count all occurrences of any chosen?
  12. Thats fine. All that info is helpful. I kind of like the frustration I think ;^) After searching online and seeing many others trying to accomplish this seemingly easy function made me headstrong. In excel this is just a COUNTIF= function - count occurences of X and put tally here. I thought the code was close. Think its missing something obviously as its not counting. Was hoping it was just me incorrectly calling the field entries. The example online I got this from was essentially doing the same thing but from an HTML forms input fields.
  13. 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. summarycardiology = 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.
  14. Yes for the libraries. Called them in from the Header. https://c3ebv137.caspio.com/dp.asp?AppKey=3f2d400026716a8f79ee4d37942f
  15. Wow. Both work well. Thank you! The script version was very educational - I can see why it works and where mine was off. The rule for hding the section is very elegant. And proof that I tend to over think things. I think this topic and solution will help other. Thanks again.
  16. Thanks douvega. The link is https://c3ebv137.caspio.com/dp.asp?AppKey=3f2d400023038023adc84db3bd83
  17. 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. 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.: The code had effect when placed in the HTML field, it prevented the block from appearing at all regardless of "Specific selection". 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?
  18. 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.
  19. How would this work for counting non binary Yes/No field like a drop down, with 4 options? Thanks!
  20. 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>
  21. God - me too!!!!! Basic Excel countif= function.
  22. 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>
  23. 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.
×
×
  • Create New...