Jump to content

Search the Community

Showing results for tags 'format'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • Caspio Apps for Ukraine
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

Found 14 results

  1. Hi. I have a table holding two fields with dates I try to compare in java script. The first date is generated by caspio timestamp, and called "date_submitted", formatted like"05/15/2014 23:43:58" in the table. The second date,"Date_event_start", is a date submitted from a Caspio calendar, formatted like "05/30/2014" in the table. When i insert both dates in a HMTL block within Caspio they retur quite different. "date_submitted" returns: "05/15/2014 11:43:58 PM" and "Date_event_start" returns: "30.05.2014" Why does Caspio default output different date formats??? I want to compare the dates with a simple script like: <HTML> [@field:Late_submitted] <a id="visi[@field:ID_delegate]"> <script> var isi = document.getElementById("visi[@field:ID_delegate]"); if('[@field:date_submitted]' >= '[@field:Date_event_start]'){ isi.parentNode.parentNode.style.backgroundColor = '#FFB0AD'; } else{ isi.parentNode.parentNode.style.backgroundColor = '#ADD8E6'; } </script> </HTML> How can i make the different date fields comparable??? --- Frode ---
  2. Hi there! I needed to convert the number input into 123,456,789.00 format on the fly while a person types in. I was not able to find a default feature on Caspio, so I wrote this script that does the job. You can check the live version here: https://c7eku786.caspio.com/dp/7f80b000b3154265003240a4b07f Script itself below: <script> document.addEventListener('DataPageReady', _=> { document.querySelectorAll('.cbFormTextField').forEach( input => { input.addEventListener('input', e => { formatDecimals(e.target)}) input.addEventListener('blur', e => { formatDecimals(e.target, true)}) }) const formatNumber = n => { return n.replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",") } const formatDecimals = (input, blurEvent) => { let inputValue = input.value; let caretPosition = input.selectionStart; let initialLength = input.value.length; if (inputValue === "") { return; } if(inputValue.indexOf('.') >-1) { let decimalPosition = inputValue.indexOf("."); let beforeDecimal = inputValue.substring(0, decimalPosition); let afterDecimal = inputValue.substring(decimalPosition); beforeDecimal = formatNumber(beforeDecimal); afterDecimal = formatNumber(afterDecimal); if (blurEvent) { afterDecimal+='00'; } afterDecimal = afterDecimal.substring(0,2); input.value = `${beforeDecimal}.${afterDecimal}`; } else { input.value = formatNumber(inputValue) if (blurEvent) { input.value+='.00'; } } let updatedLength = input.value.length; caretPosition = updatedLength - initialLength + caretPosition; input.setSelectionRange(caretPosition, caretPosition); } }) </script> If this script is being used as it is, it will convert all text inputs into the aforementioned format. If you need this functionality only for some particular input, say with name InsertRecordNumber_ (check the screenshot), you must substitute the next block of code: document.querySelectorAll('.cbFormTextField').forEach( input => { input.addEventListener('input', e => { formatDecimals(e.target)}) input.addEventListener('blur', e => { formatDecimals(e.target, true)}) }) with: let numberInput = document.querySelector('input[name="InsertRecordNumber_"]'); numberInput.addEventListener('input', e => {formatDecimals(e.target)}) numberInput.addEventListener('blur', e => {formatDecimals(e.target, true)}) Hope someone will find this helpful
  3. I have three fields in an Update Datapage (ManagementExpenses, FundraisingExpenses, and TotalRevenue) that I need to format as only numbers (no currency symbols), if someone enters $11,500.51 it would render 11500.51 or $1,500,000 would render as 1500000. I then use the numbers on a separate onchange function that calculates a % based on the three numbers in that same page. Could anyone help me with a script to remove any currency symbols if the user inputs them? I appreciate the help!
  4. Hi, I'm trying to import an excel spreadsheet but it says that some dates are not compatible but upon checking the file all of the records are on the same format. Their format is dd/mm/yyyy. Do you know why I encounter this issue?
  5. Is there a way to retain the original format of timestamp date when exported? In the table the format is mm/dd/yyyy but when data is exported it changes to m/d/yyyy. This is the format in the table. While this is the format in the exported file. I need to have the same format(mm/dd/yyyy) for my exported file.
  6. As it is right now, a data page with a calendar only has 2 options, monthly and weekly. Is there a way to create a calendar that only shows 3 Days at a time? Sincerely, Jared
  7. Can I import data in RAR format?
  8. Hi folks When you enter data into a currency field on a form it displays as a decimal number. Is there any way to get the field to format with currency signs, etc after the field losses focus? Thanks
  9. The 'Sticky headers' option in reports seems to work by 'floating' the header bar. I'm working in an iframe, so I've got a space between the top of the frame and the start of the headers row, and in this space is the 'download data' and 'search' option boxes. But when I scroll down, my lines of data end up scrolling above the header bar, filling the space where I want the the 'download data' and 'search' option boxes to remain permanently displayed. Does anyone know a way of stopping the data lines from rising above the header bar when scrolling? Thanks
  10. The thing I'm trying to achieve is that users of my app can only plan a date after today, with "rules" I am able to display a message when a user selects a date before today with the date picker. I achieve this by hiding a section when the given date is ok (Input_date > Timestamp). But while it is not possible to prevent users from submitting the form when a condition is not met, I'm trying to find a solution in javascript. The problem that occurs is that the format differs, the inputfield of the user is DD-MM-YYYY and the timestamp i compare it with is MM/DD/YYYY. Strangely this is not a problem with "rules". The code I use: <script> function myFunction(){ var StartDate = document.getElementById("InsertRecordStartDate").value; var Today = document.getElementById("cbParamVirtual1").value; // This virtual field receives the timestamp onload if (StartDate < Today){ alert('Not all conditions are met"); event.preventDefault(); } document.getElementById("caspioform").onsubmit=myFunction; </script> How can I fix this issue? Thanks in advance.
  11. Hello, I have a text field in a table (64000 characters) that is used for creating a 'footer' address, contact info section to show on certain printouts. The datapage to input the data is a single form update and the field is set to use the html editor/advanced. The datafield in question is part of the authentication. The problem is that in the datapage footer upon viewing it keeps showing all the html formatting markup. I'm using [@authfield:Company_Print_Footer!] with the '!' at the end of it like all my other html datafields (which work fine in displaying). I can't figure out why this particular one continues to show the html markup in display. Any help would be appreciated-
  12. I have a submission form that cascades data results in several virtual fields. The virtual fields reside within sections that either hide or display those elements depending on their results. What I would like to do is have all the elements that are not hidden display on the same line. Unfortunately only the elements within each section have the advanced option to “continue next element on the same line”. Is there a way to display all elements and submit button all on the same line? I tried removing the sections thus allowing me to display all elements on the same line, but with some elements being hidden the table that displayed the elements would jump around. For example.. if virt1,virt4, and virt5 are displayed on a search, then on the next search virt4 and virt5 were hidden and only virt1 and virt15 are displayed, virt15 is displayed on the far end several spaces away from virt1. Providing an undesirable result of the table cells jumping around with each search.
  13. Hello all, I am currently working on a search form (using a virtual field submission form) that has a dropdown menu to select from predefined reports. The way I would like this to function is that when the user selects an option (such as "Recent (Within the Last 10 Days)") an onchange function would change the search fields to the input needed to produce those results. I am fairly new to JavaScript, here is what I have been able to get: <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual8").value=='Recent (Within the last 10 days)') { document.getElementById("cbParamVirtual5").value= 'Doe'; } } document.getElementById("cbParamVirtual8").onchange=ocPredefinedReports;</script>​ Through Google-Fu I was able to get a function working at one point that gave me ten days ago (Unfortunately I didn't save it anywhere!) but it was in the wrong format entirely. Any and all help is much appreciated, thank you. -Blue Edit: Sorry about the terrible title, time for more coffee.
  14. Hello All!! I have a date field in which times are captured and stored some of the time. I am trying to figure out how to display the date in an HTML block in a dynamic way that displays time if present and not if empty. Please consider: Date1: 01/06/2015 Date2: 01/07/2015 17:45:00 Desired display: Date1: Jan 6th, 2015 Date2: Jan 7th, 2015 5:45PM Actual display Date1: Jan 6th, 2015 12:00AM Date2: Jan 7th, 2015 5:45PM When time is not captured it is not relevant and thus shouldn't be displayed. I have a workaround that involves a calculated field, but it's pretty clunky. Any ideas? Thanks
×
×
  • Create New...