Caspio Ninja
  • Content count

  • Joined

  • Last visited

  • Days Won


douvega last won the day on November 1

douvega had the most liked content!

About douvega

  • Rank
    Advanced Member
  • Birthday 01/12/1989

Recent Profile Visitors

254 profile views
  1. Validate Date and Time

    Hi there, I just tested this code and it works on form submit. Just remember that this Caspio Form should be the only one deployed in your webpage. <script> document.getElementById("caspioform").onsubmit = function(){ var dateOutString = document.getElementById('InsertRecordDefined_Time_Out'); var dateInString = document.getElementById('InsertRecordDefined_Time_In'); var dateOut = new Date(dateOutString.value).getTime(); var dateIn = new Date(dateInString.value).getTime(); if (dateOut <= dateIn){ alert("Please enter a date and time OUT after date and time IN "); dateOutString.value = ''; document.getElementById("cbParamVirtual6").value = ""; document.getElementById("cbParamVirtual7").selectedIndex = ""; document.getElementById("cbParamVirtual8").selectedIndex = ""; document.getElementById("cbParamVirtual10").selectedIndex = ""; return false; } }; </script>
  2. It does now, so you are trying to count how many values you have in the table. I dont think you are going the correct way. What would happen if this table is 3 pages long? How would you track the amounts in the div. The way I see it you have these three options: Getting a custom JS function to add 1 to a JSON object for every single line and then do the counting to place the results in the div (now sure how it will work in large reports) API calls from a view to count records (You have a limitation of 1000 rows max per call so if your report is greater than 1000, multiple calls are needed) Use two datapages. One for the table and the other one should be tabular too with grouping to show results in the way you want to see it. This datapage should be deployed as an iFrame in the main Table footer. In all ways, you may need to get external help in case you feel stuck, again it can be done but I dont want you to get fustrated. Please also take into consideration that this is how I see it, I am sure there may be other people that can suggest something different and it would be ok as soon as it works. Sorry for not being able to help you with a final coding but a further review is needed.
  3. Sorry, I got lost. Where is the field you want to count from? I see only a table with no edittable fields. By the way, have you tried to use the Grouping function and Aggregate field on this table to display counting results?
  4. Could you please share the datapage? Also, did you include the jQuery Library in your datapage/webpage already?
  5. How to set dropdown field type to receive parameter

    Hi, I think this article will help you accomplish that. Regards.
  6. Can you hide an HTML block with a rule?

    I just came with another idea that should work, this is by using your current HTML block content. Create a section for these two elements, Specific LSN time: and your HTML block Message. Go to Rules in your Datapage and create a new Rule. If the radio is not equal to Specific, then hide the section that contains the field and the HTML Block That would be pretty straight forward. You can learn more about this way in this article Hope it helps.
  7. Can you hide an HTML block with a rule?

    Dear roattw, Please replace your current HTML block for the following code: <div id="msg24"></div> <script> var radioField = document.getElementsByName('InsertRecordLSN_time'); var messageCnt = document.getElementById('msg24'); function getRadioValue(){ for (var i = 0, length = radioField.length; i < length; i++) { if (radioField[i].checked) { return radioField[i].value; break; } } } for (var i = 0, length = radioField.length; i < length; i++) { radioField[i].onchange = function(){ if(getRadioValue() == 'Specific'){ messageCnt.innerHTML = '<span class="cbInfoText">*24-hour clock</span>'; } else { messageCnt.innerHTML = ''; } } } </script> Let us know whether or not it works.
  8. Can you hide an HTML block with a rule?

    No, ID of <p> what just an example of quotation usage and how the HTML should be written in the variable. To provide you a definite solution, I would like to ask you to share your Datapage here as you have it right now so I can inspect it.
  9. Clearing Values in A Search Form

    Try this: <p><a onclick="clearForm()" style="cursor:pointer;">Clear Form</a></p> <script> function clearForm () { location.reload("[@cbHostPage]?cbResetParam=1"); } </script> Please note that when you search again for something, you need to get rid of "cbResetParam=1" in your URL. This is done when you redirect the page from your search form. As long as you do that, you may be fine. Let us know whether or not it works.
  10. child forms on a datapage using direct links

    Hi vanderLeest, This may be an old post but if you are still trying to get that done, I think this could help you. You can have virtual fields to get the data from your users. Then with the API, you can send whatever fields to whatever table on form submit for example. I have created some forms that all data is entered in a single form but data is being sent to multiple tables. I hope it gives you some light.
  11. I think you have some typos in your script. InsertRecordcbParmVirtual1 is incorrect, cbParamVirtual1 is the correct ID, virutal fields are not defined by Insert or Edit prefixes. Also, in dropdown fields, you can not have a keyup action since there is no such action, it should be onchange. Besides, to get dropdown values, you have a collection of objects, so you can not reference to them as you would do with normal text fields. To get dropdown values you should use: var e = document.getElementById("exactFieldID"); var ddValue = e.options[e.selectedIndex].value; To track the onchange event: document.getElementById("exactFieldID").onchange = yourFunctionName; Hope it helps.
  12. Can you hide an HTML block with a rule?

    You are pretty close to get it. You may not be able to manipulate the HTML block from the Caspio Datapage, instead, your variable must contain the HTML code. Let me give you a sample code: <div id="LSNTime"></div> <script> var linkDiv = document.getElementById("LSNTime"); var content = '<p id="uniqueParagraph">This is the content that will show </p><a class="btn btn-success" href="#">Sample Link</a>'; if('FieldReference' == 'Specific'){ linkDiv.innerHTML = content; } </script> Make sure you do good usage of single or double quotation marks. If you dont want to show anything, then the else statement is not needed. Also, be careful when assigning the Field Reference, use the dropdown in the HTML block that contains all your fields to avoid typos. Let us know whether or not you were able to accomplish it.
  13. Hide parameters in query string

    Hi NeoInJS, I have an idea that might work. Instead of using the HTML block, use the details page option in your tabular report. Once in the details section, add a virtual field and go to the Advanced tab. On load, make the value to be the one you are trying to pass and enable On exit, please save the name of the On exit parameter as you will use it in the next page. Then add a new HTML block and autosubmit the datapage. Now, in your separate Details page, the one where you are receiving the parameters at, make your On exit parameter match with your search criteria. This way you would pass parameters internally in Caspio and they wont be displayed in the URL. I hope it helps or at least gives you an idea.
  14. Clearing Values in A Search Form

    Did you add the reset button by following this help article?
  15. Multiple autosubmit

    Hi ckunkleman, For autosubmitting, you can use parameters and then an autosubmit script in your datapage but that is very slow and hard to track errors. Best way would be through API. You can loop through the 25 records and add them to your table recursively, I have done that before for a raffle system where user could sell up to 20 tickets in one shot and it worked like a charm.