Jump to content

ChrisCarlson

Caspio Guru
  • Posts

    147
  • Joined

  • Last visited

  • Days Won

    8

ChrisCarlson last won the day on May 28 2022

ChrisCarlson had the most liked content!

Recent Profile Visitors

1,541 profile views
  1. Volomeister, Thanks for the updated script. Your suggestion worked well for the more than 1 field approach. A couple issues I am running into: 1. When submitting the submission form and receiving a page error (for example, some other required field not filled out), if the user selects any option other than "Prefer not to answer" (the targetOptionName value) before submission, when the page displays after submission in the error state, it allows for any options to be selected and the script uncheck/greyout controls stops working. This only seems to be an issue on the submission datapage script, as the details page script works correctly on page errors. And this only is an issue if they select a non-targetOptionName value (if they selected the targetOptionName value before submit, the script still functions correctly when page error occurs). 2. Is it possible to make the checkbox greyout reverse in logic. For example, I have 5 multiselect options. One of them is "Prefer not to answer" which is the targetOptionName and handles great with this script, but I have another field with "Prefer to self-describe" which displays another text field for "Self-Described Race" using Caspio's built-in conditional logic where it hides/displays via a form section. The built in conditional logic does not trigger the form section hide when this script unchecks and greys out the affected option. The built in conditional logic seems to require end user click to trigger. Even though the addition of the 2nd function below would cause the user to have to manually uncheck values to be able to check the targetOptionName checkbox, it would solve the issue with the conditional logic failing to trigger by forcing the end user to click/unclick the checkbox that has conditional logic and trigger it. Are you able to edit the script to include #2 below? When targetOptionName is checked, uncheck and grey out all other checkboxes (this is working great with this script) When any other checkbox other than targetOptionName is checked, grey out targetOptionName checkbox. User has to uncheck the checkboxes to get targetOptionName to un-greyout. Thanks again for all your help!
  2. Volomeister, Thanks some much for posting the script! It works great except does not seem to work if I want to set it up on more than one field on the same datapage, when repeating the same script for each additional field. For example, I have a field called race with the option (as described above) and an additional field for gender with the same option. I pasted the script twice into my footer of submission datapage. It works good for the first instance of field on the datapage, but the second field (and I am presuming any additional fields) does not respond. This was tested in a submission form.
  3. Hello, I was wondering if anyone knows how to achieve the following or has a script written that handles list box options validation. First, I don't want to modify the data type to text as a workaround. I understand that the list box data type has several limitations but need to keep it as a list box data type for the project I am working on. I see in the article below that you can set a limit for the maximum checkbox options on a list box field. https://howto.caspio.com/tech-tips-and-articles/setting-the-maximum-number-of-listbox-selections-in-forms/ Does anyone know how to modify this script or write one that achieves the following: I want to uncheck all other checked list box items when a certain list box option is checked. In other words, when a certain value is checked I want the list box to operate as a single selection and not as a multi-selection. For example I have the following field: Race: African American or Black American Indian or Alaskan Native Asian Native Hawaiian or Pacific Islander White Prefer to self-describe Prefer not to answer When user checks the last option "Prefer not to answer" I want to uncheck all other options (if already checked) and grey them out, similar to how the max number script above functions. I am looking for a solution that works on both Submission form and Detail update datapages. Per requirements, the user can select more than one race but when selecting Prefer not to answer that should be the only value selected. I want to enforce that rule through a script (instead of relying on user accuracy).
  4. Hello, I have a details datapage with an iframe in it. The iframe is a tabular report with inline add enabled. When user adds the inline add record, I would like to update the value of a field on the parent datapage without reloading the parent page. How can I achieve this? Thanks, Chris
  5. I am using two fields in a tabular report details page: a dropdown field and a Multi-select listbox with Select All option enabled. I would like to automatically unselect all multi-select listbox items that are currently checked when a value is selected in the dropdown field. Any recommendations on how I can achieve this?
  6. Chato, You could achieve it through tasks: - create a table that acts as the staging area for transforming the records - create a table that receives the transformed records - create a task that checks the position of the ; in column c and substrings the first part into the final table as a new record and substrings the second part into the final table This process would require a case statement in tasks where it checks position of ; and transforms the value accordingly. You would need multiple if statements to check position of ; and transform accordingly. If import is daily, you could add where clause to select statement that only runs task on today's records (use difference of days between import timestamp and system timestamp = 0). You would need import timestamp added to your table for this. I am using a similar process for a few apps of mine and found it works. If you want to go that route I can share some example task screens for how it would need to be setup. If you are running any aggregate values in your apps off of this field you will want it transformed into numeric, single value only.
  7. You could use triggered actions to look for a string that replaces fields contents bases on contains. This method would update the value in the table which you could display on the confirmation page. KEYWORD_1 = @tippytv value KEYWORD_2 = Replaced error message value If you need the value to be displayed to user on the datapage, you could create a rule that runs when field contains the keyword, by hiding a section with HTML block message when field does not contain keyword.
  8. jnordsrand, I have created several apps successfully that score a test or quiz. Before the advent of calculated fields in update datapages, I had to rely on javascript to achieve this. But now with the recent Caspio release you can make use of the calculated values in virtual fields to calculate a score. Or you can score it directly in the table by creating formulas in your table that have case statements checking each answer and returning a count of 1 for Yes and 0 for No. Just string your case statement together to create a total score. I can explain in more detail if needed.
  9. George43, Thanks, I was able to get it to work following those steps.
  10. George43 I am using this script below on a details page (in the header) to check if numeric value entered exceeds 2 decimal places. How would I translate this script to work in the validation script you provided above? It work on the details page but not tabular inline edit. <script> $( function() { $('#EditRecorddeposit_checks').keyup(function(){ if($(this).val().indexOf('.')!=-1){ if($(this).val().split(".")[1].length > 2){ if( isNaN( parseFloat( this.value ) ) ) return; alert("You have entered an invalid value in the Enter Checks Deposit field. Value cannot contain more than 2 decimal places."); this.value = ""; } } return this; //for chaining }); }); </script>
  11. table[data-cb-name^="cbTable"] tr td:nth-child(10) { border-left-color: #000; border-left-style: solid; border-left-width: thin; } child() indicates the column #
  12. Hello, Is there a way to style only specific columns in a tabular report? For example, I would want only left and right borders on column #2.
  13. Hello, I am using the following script on a details page for form validation, but I would like to modify it to use for edit fields in a tabular inline edit. I noticed that the id is unique in tabular inline view and was wondering if anyone knows how to modify this to work or has an existing script that works. <script> function numericValueValidation1() { var cash=document.getElementById("EditRecorddeposit_cash").value; if(isNaN(cash)) { alert("You have entered an invalid value in the Enter Cash Deposit field. Value must be numeric. Do not include letters or symbols."); document.getElementById("EditRecorddeposit_cash").value=""; document.getElementById("EditRecorddeposit_cash").focus(); } else if((cash) < 0) { alert("You have entered an invalid value in the Enter Cash Deposit field. Value cannot be a negative amount."); document.getElementById("EditRecorddeposit_cash").value=""; document.getElementById("EditRecorddeposit_cash").focus(); } } document.getElementById("EditRecorddeposit_cash").onchange = numericValueValidation1; </script>
×
×
  • Create New...