Jump to content

MayMusic

Caspio Evangelist
  • Content Count

    1,510
  • Joined

  • Last visited

  • Days Won

    73

Reputation Activity

  1. Like
    MayMusic reacted to kme in Timestamp When "y" Clicked   
    MayMusic - Thanks so much, it is working now.
     
    For those interested in the solution, 
    The additional problem was that Timestamp field in the Table had to have a datatype of Text(255).
    In the Details Page, Timestamp was changed to a Text Field. Once Yes was clicked, the textfield was filled with a timestamp, and then when Update was clicked, the field in the Results Page was filled with the timestamp.
     
    Thanks again.
  2. Like
    MayMusic got a reaction from Domco in Reduce Row Hight   
    It is good to know the order for padding which is :
     
    padding: top right bottom left
  3. Like
    MayMusic got a reaction from Domco in Borders Between Rows When I Deploy To Wordpress   
    In the style under Form/Details >> Layout make sure you do not have border for label cells, field cells and etc
  4. Like
    MayMusic got a reaction from Domco in Conditionally Show/hide Html Based On User Access Level   
    This line is missing closing "]"
    var type_manager = '[@authfield:manager]'; and in your code you have added } by mistake
  5. Like
    MayMusic got a reaction from jonathanr in Possible To Show A Search Form And An Initial Dataset On Page Load?   
    The report needs to be a predefined report, so for the existing one you can check it to be a predefined report and then receive all the search parameters in Configure Filtering Fields screen
  6. Like
    MayMusic got a reaction from Domco in Rich Text Area   
    1. Your table has a text 64k field called "html_text". Your DP includes the field and form element is text area.
    2. Place the following code in the DP header:
     
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/assets/skins/sam/skin.css"> <!-- Utility Dependencies --> <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script> <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script> <!-- Needed for Menus, Buttons and Overlays used in the Toolbar --> <script src="http://yui.yahooapis.com/2.5.2/build/container/container_core-min.js"></script> <script src="http://yui.yahooapis.com/2.5.2/build/menu/menu-min.js"></script> <script src="http://yui.yahooapis.com/2.5.2/build/button/button-min.js"></script> <!-- Source file for Rich Text Editor--> <script src="http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js"></script>
    3. Place the following code in the DP footer:
     
    <script> window.onload = function() { var myEditor = new YAHOO.widget.Editor('InsertRecordhtml_text', {    height: '400px',    width: '600px',    dompath: true,    animate: true         }); myEditor.render();                 document.getElementById("caspioform").onsubmit = function() {                     myEditor.saveHTML(); //var myHTML = myEditor.get('element').value;                 }             } </script>
    4. Your webpage should have <body class="yui-skin-sam">

    5. The 'InsertRecordhtml_text' should be updated with your field name reference.


    ----- On Update page and Details Page -----

    Repeat Steps 1 through 4.
    on Step 5 replace 'InsertRecordhtml_text' with 'EditRecordhtml_text' where the html_text is your field name.


    Now if you wish to dispaly data on your DataPage as "Dispaly only" format make sure to Render the value as "HTML". Data is being saved into the table along with HTML tags.
  7. Like
    MayMusic got a reaction from wayanmariasa in Field Length   
    This is possible by setting fixed width for results page label and data elements in the style. To do so, follow the steps below:

    1-    Edit the Style and enable "Show advanced options (CSS Source)"
    2-    Move on to the Settings screen and expand Results Page
    3-    Select Label, switch to Source tab and find ".cbResultSetLabel". Add the following:

    display: inline-block;
    width: 70px;

    4-    Select Data and find ".cbResultSetData". Add the following:

    display: inline-block;
    width: 100px;

    You can play with the width number to get the best fit for your page.

    NOTE: inline-block style should NOT be applied to Tabular DataPage labels/data fields.

    *** Changes you make in a style will affect all the pages that are using it. It is strongly recommended to make a copy of the style, apply it to your DataPage and make the changes in the copy one.
  8. Like
    MayMusic got a reaction from Domco in Conditionally Show/hide Html Based On User Access Level   
    Did you try to add a div and give it an ID then hide the div like
     
    document.getElementById('DIV ID').style.display = 'none';
     
    and show other:
    document.getElementById('DIV ID').style.display = 'block';
  9. Like
    MayMusic got a reaction from Domco in Field Length   
    This is possible by setting fixed width for results page label and data elements in the style. To do so, follow the steps below:

    1-    Edit the Style and enable "Show advanced options (CSS Source)"
    2-    Move on to the Settings screen and expand Results Page
    3-    Select Label, switch to Source tab and find ".cbResultSetLabel". Add the following:

    display: inline-block;
    width: 70px;

    4-    Select Data and find ".cbResultSetData". Add the following:

    display: inline-block;
    width: 100px;

    You can play with the width number to get the best fit for your page.

    NOTE: inline-block style should NOT be applied to Tabular DataPage labels/data fields.

    *** Changes you make in a style will affect all the pages that are using it. It is strongly recommended to make a copy of the style, apply it to your DataPage and make the changes in the copy one.
  10. Like
    MayMusic got a reaction from Stratz1081 in Convert Text Number To Phone Format.   
    Then you need to create an array. Try this:
    <SCRIPT LANGUAGE="JavaScript"> var o_els = new Array("EditRecordPhone_Work","EditRecordPhone_Cell","EditRecordPhone_Fax") ; function tel() {  // Read the content of the textbox // var message = document.getElementById("EditRecordPhone_Home").value;   //Skip function if textbox is empty, else you will see () - for (var i = 0; i < o_els.length; i++) { if (o_els[i] != "") { var message=document.getElementById(o_els[i]).value;   // Strip off all the spaces document.getElementById(o_els[i]).value = (message.replace(/[^\d]/g, '')); var message1 = document.getElementById(o_els[i]).value; document.getElementById(o_els[i]).value = ("(" + message1.substring(0,3) + ") " + message1.substring(3,6) + "-" + message1.substring(6,10)); } }  } // Call function when value in the textbox changes for (var i = 0; i < o_els.length; i++) { document.getElementById(o_els[i]).onchange=tel; } </SCRIPT>
  11. Like
    MayMusic reacted to nkamalan in Fill text fields with existing info if the checkbox is check   
    Please try this code in an HTML block at the very end of the element list or in the footer:
     
     


    <script>
    function f_address()
    {
        if(document.getElementById('cbParamVirtual1').checked)
        {
      document.getElementById('InsertRecordBilling_Address').value=document.getElementById('InsertRecordShipping_Address').value;
    document.getElementById('InsertRecordBilling_City').value=document.getElementById('InsertRecordShipping_City').value;
    document.getElementById('InsertRecordBilling_State').value=document.getElementById('InsertRecordShipping_State').value;
    document.getElementById('InsertRecordBilling_zip').value=document.getElementById('InsertRecordShipping_zip').value;
    } else {
    document.getElementById('InsertRecordBilling_Address').value="";
    document.getElementById('InsertRecordBilling_City').value="";
    document.getElementById('InsertRecordBilling_State').value="";
    document.getElementById('InsertRecordBilling_zip').value="";
    }


    }
    document.getElementById('cbParamVirtual1').onclick= f_address;
    </script>


     
    Please note in here you need to replace cbParamVirtual1 with the ID of the checkbox and all other field IDs with the appropriate ID you have in your form. 
     
    I have one suggestion since you are using Java Scripts. Use Firefox and install Firebug which is an add-on for Firefox, free and open source. It allows the debugging, editing, and monitoring of any website's CSS, HTML, DOM, and JavaScript, and provides other Web development tools. It also has a JavaScript console for logging errors and watching values, as well as a "Net" feature which monitors the amount of time in milliseconds it takes to execute scripts and load images on the page. I am also using Firebug to get the ID of an element.
     
    Cheers    
  12. Like
    MayMusic got a reaction from ShWolf in Search By Year   
    In the search page for this field try to add criteria to the field and select OR as the operator between values. But you only have Date, Date and Time, Month and Year and Year options you cannot only choose Month !!! Give it a try and let me know though.
     
    To add criteria to the field highlight the field name in Configure Search Field screen and then from the picker where you add HTML Block/Header/Footer you can also select Criteria
  13. Like
    MayMusic got a reaction from wharton in Update Button On Details Page Won't Go Away   
    There should be something in the page like virtual field or something. You can hide these buttons in the style. Open style and go to setting screen, under forms/details highlight buttons and switch to source tab look for cbBackButton and cbUpdateButton and add display:none;
     
    If you can provide me the link of the page here I will be able to tell you why it is still showing up
  14. Like
    MayMusic got a reaction from juancoffee in Restrict Dates And Numbers Of People   
    This code can help you to prevent from entering previous dates:
    <script> function checkdate(){ alert('in'); var sdate = document.getElementById('InsertRecordDATEFIELD').value; if (Date.parse(sdate) < Date.now()) {     alert("Choose a date after today");     return false; } } document.getElementById('caspioform').onsubmit=checkdate; </script> Replace "DATEFIELD" with the date field name. And if the code is being used in an update page change InsertRecord to EditRecord.
  15. Like
    MayMusic got a reaction from NaghmehK in Submit One Form To 2 Different Tables?   
    You can create another DataPage based on the other table and have it as the destination after submission. Check to receive the parameters that need to be passed to this page and received them on the new page. In the second page you can have auto submit button upon page load by having this code in an HTML Block at the end of the list elements:
    <script> function f_submit() { document.getElementById("caspioform").submit(); } document.addEventListener('DataPageReady',f_submit); </script> After adding data to the first page, user will be redirected to the next page which will be auto submitted and user will see the successful submission message. If you would like you can hide the submit button and also the fields on the page.
     
    To hide the submit button, create a copy of the style. Check Show Advanced Options (CSS Source), navigate to setting screens and under Firms/Details >> Buttons switch to Source tab and add display:none; to .cbSubmitButton
    To hide elements use table tags: http://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-hide-fields-in-datapages/
  16. Like
    MayMusic reacted to MayMusic in Date Field Validation   
    You can try to add an HTML Block at the end of the list and have this code in:
    <script> function chk_date(){ if ( new Date(document.getElementById('InsertRecordDATEFIELDNAME').value) < new Date() ) {  alert("Select a day after now !");  document.getElementById('InsertRecordDATEFIELDNAME').value = null;  return false; } else {document.getElementById('caspioform').submit();} } </script> <input type="button" onclick="chk_date()" value="Submit"> You need to hide the default submit button in the style by adding display:none; to .cbSubmitButton
     
    Make sure to replcae DATEFIELDNAME with the actual field name
     
    :rolleyes:
  17. Like
    MayMusic got a reaction from jonathanr in Date Field Validation   
    You can try to add an HTML Block at the end of the list and have this code in:
    <script> function chk_date(){ if ( new Date(document.getElementById('InsertRecordDATEFIELDNAME').value) < new Date() ) {  alert("Select a day after now !");  document.getElementById('InsertRecordDATEFIELDNAME').value = null;  return false; } else {document.getElementById('caspioform').submit();} } </script> <input type="button" onclick="chk_date()" value="Submit"> You need to hide the default submit button in the style by adding display:none; to .cbSubmitButton
     
    Make sure to replcae DATEFIELDNAME with the actual field name
     
    :rolleyes:
  18. Like
    MayMusic got a reaction from jonathanr in Caspio Capabilities - Client Serving Database, Dynamic Tables And Charts   
    You can request for a 2 week trial account and try it out. You should be able to implement all these http://www.caspio.com/signup/trial.aspx
     
    1. Can a caspio database using as a client (human users) serving database, whereby my clients can log in review and manipulate data and download data in an Microsoft Excel file?
    >>You can create an authenticated reprot and let the user to searcg for records and edit them either in reoport page or details page
    http://howto.caspio.com/videos/getting-started/searchable-database/create-a-searchable-database-2-of-3-creating-a-report.html
    http://howto.caspio.com/videos/getting-started/password-protection/
     
    2. A dynamic table where a client can view/manipulate multiple fields/metrics. Eg look at fertilisation costs for Argentina and Brazil farms, or US production by farm.
    >> I am not sure what you mean by dynamic table but you should be able to create a view out of a table to filter a table and then use it as a source of a report
     
    3. A dynamic variable width stack chart (also known as an industry cost curve) which displays cost info (y-axis) and production info (x-axis) - client would need to manipulate this curve and then download as pdf. We currently use a excel macro to generate these curves
    >> You can either create a chart DataPage or a combined chart and report http://howto.caspio.com/datapages/creating-datapages/creating-a-combined-chart-and-report-datapage/combined-chart-and-report-example.html and http://howto.caspio.com/datapages/creating-datapages/creating-a-chart-datapage/
     
    4. A map page - basically a google may which pinpoints each farm. When a uses clicks a point on the map it will bring up basic info
    >> Tutorial that shows how to create a google map to show the data from your table on it: http://howto.caspio.com/extensions/maps/map-mashup-instructions/map-mashup-version-7/
     
    5. Basic farm list page - whereby a client can click on a farm name and download a basic financial model for that farm (excel file)
    http://howto.caspio.com/datapages/creating-datapages/creating-a-search-and-report-datapage/how-to-search-results-downloadable-for-users.html
     
    6. Finally a basic page for each farm site (bearing in mind there are 5000+ farms) which displays the individual data for that site and for each number, where applicable, a click through to a pdf document where it was sourced.
    >>You can create a report on the table you have all farms information in and for  each record you can have a PDF to show as explained here http://howto.caspio.com/tech-tips/tech-tip-embed-documents-in-datapages.html
     
    Caspio has a developer team that can build your whole orpart of the app for you which will save you time and money. To get a price quote fill out this form at http://www.caspio.com/support/professional-services.aspx
  19. Like
    MayMusic got a reaction from suzainwatson in Remove ALL html elements except defined... no CSS, etc.   
    You can try to create a new style, check "Show advanced options (CSS Source)" and then in Setting screen on Source tab under All remove all the CSS classes.
  20. Like
    MayMusic reacted to caspio in JS: Format tabular display on result page in four ways   
    JavaScript Solution: Format tabular display on result page in four different ways

    Feature Description:
    This JavaScript solution shows how to format the Results page of a Search and Report DataPage in four different ways. For ease of reference, these formats are referred to as Type A, Type B, Type C and Type D respectively. The details are:
    a. Type A: Individual column - Background color
    b. Type B: Individual column - Font weight
    c. Type C: Individual row - Font weight
    d. Type D: Individual column - Conditionally format background color

    Features in this solution that can be easily customized are,
    a. Column number for Type A formatting.
    b. Column number for Type B formatting.
    c. Row number for Type C formatting.
    d. Column number for checking if a specified condition is met.

    Implementation:
    This solution can be used "as-is", without any changes if
    a. It is used in a Search and Report DataPage and
    b. The table to be formatted is the first table of the web page in which the DataPage is embedded,
    c. The 2nd column is to be formatted as Type A,
    d. The 3rd column is to be formatted as Type B,
    e. The 2nd row is to be formatted as Type C,
    f. The 3rd column is to be formatted as Type D if a cell in the column contains the value Yes.
    Note: Conditional formatting may not be displayed if the condition being checked is not satisfied by the data in the specified column.

    To use this solution,
    a. Highlight the code provided in the text area shown below and copy it.
    b. Paste it inside the HTML Footer section of the Results page using the Caspio Bridge DataPage Wizard.
     
    <SCRIPT LANGUAGE="JavaScript"> /*(1) tablenum is the number of the table to be formatted */ var tablenum = 0; /*(2) Two columns used for the different formatting styles */ var columnNum1 = 1; /*used in Type A */ var columnNum2 = 2; /*used in Type B and Type D */ /*(3) rowNum is the number of the row to be formatted */ rowNum = 2; //used in Type C /*(4) variables for colors. */ var white = '#FFFFFF'; var lightGrey = '#CCCCCC'; var yellow = '#FFFF00'; /*(5) variables for font style */ var fontStyle1 = 'bold'; /*(6) variable for condition to check in conditional formatting, Type D.*/ var conditionString = "Yes"; var tbl = document.getElementsByTagName('table')[tablenum]; var rows = tbl.getElementsByTagName('tr'); /*(7) Type C: style individual row: fontWeight */ rows[rowNum].style.fontWeight = fontStyle1; for (var row=0; row<rows.length;row++) { var cells = rows[row].getElementsByTagName('td'); /*(8) Type A: style individual column: background color */ cells[columnNum1].style.backgroundColor = lightGrey; /*(9) Type B: style individual column: fontweight */ cells[columnNum2].style.fontWeight = fontStyle1; /*(10) Type D: conditional formatting. */ if (cells[columnNum2].innerHTML == conditionString) { cells[columnNum2].style.backgroundColor= yellow; } } </SCRIPT> To customize this solution, change the values of the variables tablenum, columnNum1, columnNum2 and rowNum as required.

    Additional Considerations
    This solution may be difficult to customize if the web page in which the DataPage is embedded, contains a large number of tables. In order to see the full effect of this solution, the appropriate columns and rows have to exist in the data table. Variations of such formatting can be implemented easily by using this solution as a guideline.

    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 8.0, Firefox 3.5.7, Chrome 3.0.195.38, Safari 4.0.3
    # Macintosh - Firefox 3.5.7, Safari 4.0.3

    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees.
×
×
  • Create New...