Jump to content

MayMusic

Caspio Evangelist
  • Content Count

    1,510
  • Joined

  • Last visited

  • Days Won

    73

Reputation Activity

  1. Like
    MayMusic got a reaction from ManonG in Auto Submit Dropdown   
    <script type="text/javascript">   document.addEventListener("DataPageReady", function(event) { var dropdownvalue = document.getElementById("DropDownID").value; if (dropdownvalue == "THISOPTION")   document.forms["caspioform"].submit(); )} ; </script>
  2. Thanks
    MayMusic got a reaction from Ed727 in Remove scrollbar on listbox   
    Add this code to the header of the screen:
     
    <style> .cbFormSelect{ display: inline-block; vertical-align: top; overflow: hidden; border: solid grey 1px; } .cbFormSelect select{ padding: 10px; margin: -5px -20px -5px -5px; } </style>  
  3. Like
    MayMusic got a reaction from davidjeson in is it possible to disable AJAX without disabling JavaScript completely   
    Java scrip will not get disabled if you disable AJAX, but you need to adjust the code to work. For instance if you are using Caspio event handlers you need to replace them. Refer to this https://howto.caspio.com/release-notes/caspio-bridge-13-0/13-0-impacted-areas/.
    You need to reverse your code back.
  4. Thanks
    MayMusic got a reaction from Prophecy in Dynamic Sections in Datapages   
    Assign an ID to each section by adding HTML blocks before and after and under advanced tab uncheck HTML editor.
    HTML Block above:
    <div id="first_Section">
    HTML Block below:
    </div>
    Then have a JS to get the value and show/hide the section. If you have the link to the page I can give you the code
  5. Like
    MayMusic got a reaction from Alwayslost in Live Application Samples   
    Check these ready-made apps https://www.caspio.com/apps/
  6. Like
    MayMusic got a reaction from Syvill in Multiple submission base on user input   
    The source of the submission is different from where you get all rows. There are 3 tables here. One is QTY which has one Integer field holding 1 to 50. Two same tables MultiSubmit and MutliSubmitDetails.
     
    Submission is based on MultiSubmit and MutliSubmitDetails are having all rows including the initial row. 
     

  7. Like
    MayMusic got a reaction from Deanne in Elimate custom value on dropdown   
    This is not customizable by standard features. You can either have a default value or not.  But using JS. you can count the number of options in the dropdown when it is fully loaded and if there is only two then remove the first option.
     
  8. Like
    MayMusic got a reaction from yoinkadventures in Hide "Register as new user" after logged in   
    It is better to have the link to the registration page and also a link to retrieve the password in the footer of the Authentication. Edit your authentication and use the + Sign to add Header/Footer and create your hyperlinks in the Footer of the page.  So the user will always see the login and two links to register or retrieve password. 
  9. Thanks
    MayMusic got a reaction from Vitalikssssss in Total Hours Worked / Datediff   
    Count the total mins either in the table or as cal field on your report. Here we call it TimeSpan

     

    Datediff(minute,[@field:StartTime], [@field:EndTime])

     

    Then in the aggregation use that to get the total:

     

    CAST ((SUM(TimeSpan)/60) AS VARCHAR(6)) + ':' +CAST ((SUM(TimeSpan)%60) AS VARCHAR(2))

  10. Like
    MayMusic got a reaction from jafranklin77 in Phone number Formatting   
    Are you trying the code on an update form or submission form? the format of the IDs you are referring to on an update/details page is different from submission. What is the link to the page where you have this code on which is throwing an error?
  11. Like
    MayMusic got a reaction from jafranklin77 in Phone number Formatting   
    In this link, you can find how to refer to an element on different DataPage types
     
  12. Like
    MayMusic got a reaction from jafranklin77 in Auto format a phone number field javascript   
    You can try to add a if statement to check and see if it is blank. For instance:
     
     
    <SCRIPT LANGUAGE="JavaScript"> function tel() { var message = document.getElementById("InsertRecordTEL").value; // here you get what the end-user typed if (message != "") { document.getElementById("InsertRecordTEL").value = (message.replace(/[^\d]/g, '')); // then you strip off all the spaces var message1 = document.getElementById("InsertRecordTEL").value; document.getElementById("InsertRecordTEL").value = ("(" + message1.substring(0,3) + ") " + message1.substring(3,6) + "-" + message1.substring(6,10)); } } document.getElementById("caspioform").onsubmit=tel; </SCRIPT>
  13. Like
    MayMusic got a reaction from viviannaidoo in Copy data from one table to another when a field matches   
    If that is the case, you can create a TASK instead of a triggered action. The difference is that it will run on a scheduled basis and will move the percent for all matching names.
  14. Thanks
    MayMusic got a reaction from kpcollier in Change background color after expired   
    Since in pivot you cannot use JS I do no think we can customize the color of the data
  15. Like
    MayMusic got a reaction from jimarch in Single Sign On - One Table for All Apps   
    So basically you need to share the member user table among apps. There needs to be another field in this table which is holding the app name. Now the authentication for each app should be based on a view which is filtered by app name field.
  16. Thanks
    MayMusic got a reaction from Henco in Number to Hexadecimal converter   
    If you are on a submission DataPage and you have an input for the number with the field name: "NumberValue" and another field where you want to store "Hex" you can use the code below in the footer
    <div id=d1></div> <script language='JavaScript' type='text/JavaScript'> <!-- document.getElementsByName("Submit")[0].onmouseover = function (){ var n1=document.getElementById("InsertRecordNumberValue").value; if(isNaN(n1)){ document.getElementById("d1").innerHTML=document.getElementById('t1').value + " is not a number "; }else{ n1=parseInt(n1); var h = document.getElementById("InsertRecordHex").value =n1.toString(16); // Change the toString(16) to toString(8) or toString(2) get Octal and binary conversion } } //--> </script> on Details or update page as long as the form element is not "display only" and "cascading" you can change "InsertRecord" to "EditRecord" in the code above. 
  17. Like
    MayMusic got a reaction from Taneya in Dropdown List   
    You can change the DataType of the school field in the table from text to List - String and add the school options to the table. Refer to https://howto.caspio.com/tables-and-views/data-types/list/. 
    Then the user will have the option to select more than one or all
  18. Thanks
    MayMusic got a reaction from MiCro in Rule Help   
    Let's say if the value in another field is OTHER you want to unhide this field and make it require. Then you need to first add a section and have this field in a section as only one action per field is possible. Two rules you need:
    1- Value = OTHER make the field required
    2- Value is not equal = OTHER Make it Hidden
    So you are doing it the other way around instead of saying
    if value = OTHER Unhide
    you say
    If value is not OTHER Hide
  19. Like
    MayMusic got a reaction from molly1990 in Yesterday's Date   
    Use this code in the footer of the submission page:
    <script> today = new Date(); yesterday = new Date(today); yesterday.setDate(today.getDate() - 1); var dd = yesterday.getDate(); var mm = yesterday.getMonth()+1; //January is 0! var yyyy = yesterday.getFullYear(); if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} yesterday = mm+'/'+dd+'/'+yyyy; document.getElementById("InsertRecordStartDate").value = yesterday; </script> I got this code from https://stackoverflow.com/questions/16686640/function-to-get-yesterdays-date-in-javascript-in-format-dd-mm-yyyy
  20. Thanks
    MayMusic got a reaction from Shuchi in SQL Filtering with Auth field in where clause not working   
    If you are using SQL SELECT to read the value you need to use the name of the field form that table not using parameter
     
    so you need to have:
     
    SELECT COUNT(DISTINCT PropertyKeyId) FROM UI_FactTrxn_1 WHERE InvestorUserId = [@authfield:Users_UserId] And you do not have to replace the value with 0 as COUNT returns 0 if there is none. 
  21. Thanks
    MayMusic got a reaction from Harbinger in Creating a button in Search and Results DataPage when no records found   
    Yes all these messages are in the localization you are using for this report page. Create a copy of the localization and under  Results Pages >> Messages >> 351 No Records Found >> Add your custom text. You can also add HTML tags for instance <a href="UTL OF THE PAGE"> Add New </a> or you can also have JS. 
  22. Thanks
    MayMusic got a reaction from Master in Updating Data inside dropdown   
    Base all of your dropdowns on a lookup table

    This technique requires using a lookup table as the base reference for your dropdowns. Lookup table based dropdowns have several advantages over using custom values. If you do not currently use a lookup table you can find steps to create one here.

    Create a Submission Form to your lookup table

    First, we are going to create a Submission Form DataPage so users can submit new records directly to the lookup table.

    Click New DataPage. By default, the cursor selects Submission Form as the first DataPage type. Click Next.
    Select your lookup table as the data source. Click Next.
    You can select which fields to be used in your submission form. To select fields, move the fields from the Available Fields list to the Selected Fields list. Because you are submitting to a lookup table, it is likely that there will only be one (or very few) fields. Click Next.
    Format the Field as needed, Go to the Advanced Tab and check “on exit to pass field value as parameter”. Note the parameter name as you will use that name in your Javascript. Click Next again.
    Now on the last page, replace the success message with a JavaScript. This JavaScript will close the popup window and the new dropdown items will be visible. Go to the Source mode and insert the following JavaScript into the message panel:

     
    <script>

    window.close();

    //Replace the FieldName with the Submission form FieldName(parameter name passed when you checked “on exit”.

    var element_value='[@InsertRecordFieldName]'

    var new_item = window.opener.document.createElement("option");

    new_item.text=element_value;

    new_item.value=element_value;

    // Add new item to the dropdown

     try

    {

    //Replace the FieldName with the Original DataPage dropdown FieldName

    window.opener.document.getElementById("InsertRecordFieldName").options.add(new_item, null);

    }

    catch(ex)

    {

    //Replace the FieldName with the Original DataPage dropdown FieldName

    window.opener.document.getElementById("InsertRecordFieldName").options.add(new_item);

    }

    </script>

    Click Finish to Save Your DataPage.
    Deploy Submission Form

    1. Select the Submission Form again and click the Deploy button. In order for the script to work, both DataPages must be embedded in webpages with the same domain name. You can make an empty webpage containing only the following HTML:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <body>

    CASPIO DEPLOY CODE

    </body>

    </html>

    2. Replace "CASPIO DEPLOY CODE" with the deploy code of your submission form. If your original form is deployed using the URL deployment method you can deploy the submission form using the same method.

    3. Copy the URL of the submission form and save it for use in the next step.

    Create a link in your original DataPage

    Now in your original form, you add a link that will display a popup window containing the Submission Form from the previous step.

    Select the DataPage where you would like to add the link and open the DataPage Wizard by clicking Edit. On the second screen be sure to enable advanced options.

     
    Proceed to the Configure Fields screen. Using the Insert button at the lower right of the DataPage Elements panel, add an HTML block. Go to the Source mode and insert the following link code into the HTML panel:
    <a onclick="window.open('DataPageURL','popup','width=307,height=341,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">Add Option</a>

    Replace the DataPage URL portion with the URL of the first Submission Form. Update the other options in this hyperlink as needed.
    To move the link to the same line as the dropdown, select the dropdown DataPage element and go to the Advanced tab. Click the Checkbox for Continue next element on same line.
    Click Finish to save your DataPage

     

     

     
     
  23. Thanks
    MayMusic got a reaction from Master in Simple View Setup Question   
    Create a relationship and in your relation ship choose to see the name instead of ID, this will resolve the issue. Refer to http://howto.caspio.com/tables-and-views/relationships/relationship-settings/
  24. Thanks
    MayMusic got a reaction from jasonkaeb in Reset button on Search Form does not work as needed   
    If you have ajax enabled the reset button would not work and as DevArora mentioned above you  need to clear the values with JS
  25. Like
    MayMusic got a reaction from paulmurphy in Multiple "Clients" with restricted views/access in an App?   
    If you would like to receive the value in a submission/update or details page to stamp it to the record then you can change the form element to hidden and receive the parameter from authentication.  https://howto.caspio.com/authentications-and-connections/authentication/stamp-a-record-with-user-profile-data/
    In report pages to return user-related data  https://howto.caspio.com/authentications-and-connections/authentication/record-level-security/
     
×
×
  • Create New...