Jump to content

MayMusic

Caspio Evangelist
  • Content Count

    1,510
  • Joined

  • Last visited

  • Days Won

    73

Reputation Activity

  1. 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/
  2. Like
    MayMusic got a reaction from Brett in Encrypted Parameters in URL   
    Here is an answer I received from a Caspio expert:
    Create an Autovalue field in the Clients submission form where a new record is being created. The Autovalue creates Random Unique ID for each submission, the setting of the Autovalue should be "For Application Use" not "For Human Use". Then in your custom details URL you need to pass this parameter instead of the sensitive data.
    Let me know if it helps :wink: :wink: :wink:
  3. Like
    MayMusic got a reaction from ram101 in Using Caspio in your business   
    Yes there are reseller accounts in Caspio. If you go with corporate you get 400 DPs and you can purchase more along the way if you need to. https://www.caspio.com/pricing/
  4. Thanks
    MayMusic got a reaction from vanderLeest in Combine 2 fields into 3rd on Inline Insert   
    I tried this code and it worked for me
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var CompanyID = document.getElementsByName("InlineAddRed")[0].value; var Area = document.getElementsByName("InlineAddGreen")[0].value; var CompanyID_Area = CompanyID + Area; alert(CompanyID_Area ); document.getElementsByName("InlineAddallcolor")[0].value = CompanyID_Area; } document.getElementById("Mod0InlineAdd").onclick=concatenate; </SCRIPT>  
  5. 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

     

     

     
     
  6. Thanks
    MayMusic got a reaction from vanderLeest in Validation of standard fields on Comment, Request or Registration Form   
    In your submission or update page for Email field you can select EMAIL special element  from Form Element dropdown. To not let user enter numbers
     
    To prevent user from entering numbers for First_name field on submission page you can have:
     
    document.getElementById('InsertRecordFirst_Name').onkeyup= function(v_e){ v_e = v_e || window.event; if (v_e.keyCode > 47 && v_e.keyCode< 58) { this.value = this.value.substr(0, this.value.length - 1); return false; } }  
  7. Like
    MayMusic got a reaction from Breee in Hiding the header   
    You just need to replace window onload event:
    <script>function func_NoRec_Header() { if (document.getElementById("norecord")) document.getElementById("HideHeader").style.display = "none"; } //window.onload=func_NoRec_Header; document.addEventListener('DataPageReady', func_NoRec_Header); </script>  
  8. Thanks
    MayMusic got a reaction from douvega in Collapsible group, only one open by default   
    Each category value needs to be a plain text for instance:
    var category1 = document.querySelectorAll("[class^=cbResultSetGroup1Label]")[0].innerText.replace(/\s/g, ""); var category2 = document.querySelectorAll("[class^=cbResultSetGroup1Label]")[1].innerText.replace(/\s/g, ""); var category3 = document.querySelectorAll("[class^=cbResultSetGroup1Label]")[2].innerText.replace(/\s/g, ""); Then let's say if you want the top1 group value to be expanded by default:
    if(category1 == "Top1"){ document.getElementsByTagName("span")[1].setAttribute("data-cb-collapsed", "true"); document.querySelectorAll("[id^='DataRow'][class^='cbResultSetDataRow']")[0].setAttribute("style", "display: true"); } else if(category2 == "Top1"){ document.getElementsByTagName("span")[2].setAttribute("data-cb-collapsed", "true"); document.querySelectorAll("[id^='DataRow'][class^='cbResultSetDataRow']")[1].setAttribute("style", "display: true"); } else if(category3 == "Top1"){ document.getElementsByTagName("span")[3].setAttribute("data-cb-collapsed", "true"); document.querySelectorAll("[id^='DataRow'][class^='cbResultSetDataRow']")[2].setAttribute("style", "display: true"); }  
  9. Like
    MayMusic reacted to danielg05 in Submit One Form To 2 Different Tables?   
    With regards to Chris and May,  because of recent releases and the asynchronous enhancements I was receiving an error message form the bridge about the "onload" event so I think this should suffice:
    <script type="text/javascript"> function f_submit() { document.getElementById("caspioform").submit(); } document.addEventListener('DataPageReady',f_submit); </script> Ref:
    https://howto.caspio.com/deployment/?_ga=2.55701288.248583459.1515247308-2040463417.1503146327
  10. Like
    MayMusic got a reaction from Danny in 2 functions in a script one works   
    You are not calling the second function at all but you call the first one two time. You to change the last line to:
    document.getElementById("caspioform").onsubmit=calculate2;  
  11. Like
    MayMusic got a reaction from Master in Custom search that Includes any of enetered texts   
    If you send some words separated with OR like : John OR Mike and then in your report page receive this value and comparison type should be CONTAINS
    You need to separate your search and report in two page: https://howto.caspio.com/tech-tips-and-articles/tech-parameters/how-to-separate-search-page-and-results-page-into-two-different-webpages/
    Then in the search page add a JS to the Footer of the page to replace the spaces you have on search field with OR.
    <script> function rep(){ var str= document.getElementById('cbParamVirtual1').value; document.getElementById('cbParamVirtual1').value =str.replace (/ /g, ' OR '); } document.getElementById('Submit').onmouseover = rep; </script> Virtual 1 if the virtual field you added to your search page and you need to check the value to the next page on submit.
  12. Like
    MayMusic reacted to GoCubbies in Wanted To Share This Third Party Pdf Generator   
    Hello All,
     
    I just wanted to share this link with everyone in case you are looking to create a quick PDF from a DataPage: http://pdfcrowd.com/save-to-pdf/
     
    You can simply add this line of code to create a link to generate a PDF:
    <a href="//pdfcrowd.com/url_to_pdf/">Save to PDF</a> Just wanted to share this with everyone!
  13. Thanks
    MayMusic got a reaction from danielg05 in Submit One Form To 2 Different Tables?   
    You to check to pass AutoNumber or any Auto generated values from submission page as follow

     
    Then on the next page you can receive these values in this format:
    [@InsertRecordFIELDNAME]
     
    FIELDNAME is the name of the field in your table.
  14. Like
    MayMusic reacted to Mathilda in Current day of the week in an App Parameter   
    In this case you may use java script. I created a simple example for you, you should paste script in the footer of the datapage:
    <script> window.onload = function myFunction() {     var d = new Date();     var weekday = new Array(7);     weekday[0] = "Sunday";     weekday[1] = "Monday";     weekday[2] = "Tuesday";     weekday[3] = "Wednesday";     weekday[4] = "Thursday";     weekday[5] = "Friday";     weekday[6] = "Saturday";     var n = weekday[d.getDay()];     document.getElementById("InsertRecordField_name").value = n; } </script> Enter name of your field instead of: Field_name
  15. Like
    MayMusic got a reaction from vikovs in Remove "Data Table" tooltip   
    I have not tried the code but syntax needs a little modification:
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script> $(document).ready(function(){ $("table[data-cb-name='cbTable']").removeAttr("title"); }); </script>  
  16. Like
    MayMusic got a reaction from telepet in Convert Text Number To Phone Format.   
    @telepet
     
    Change this line
    document.getElementById(o_els[i]).onchange=tel;  
    To:
    document.getElementById(o_els[i]).onkeyup=tel;  
  17. Like
    MayMusic got a reaction from alexm72 in Is It Possible To Preview An Image Before Uploading?   
    add a HTML Block wight below your file field and use the code below:
    <img id="blah" src="#" alt="your image" /> <script> $('#InsertRecordphoto').change(function(e){ var field = e.currentTarget; readURL(field); }); function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah') .attr('src', e.target.result) .width(150) .height(200); }; reader.readAsDataURL(input.files[0]); } } </script> Replace "InsertRecordphoto" with the file field actual ID.
     
    Add the following line to header of your web page source:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <meta charset=utf-8 />
  18. Like
    MayMusic got a reaction from vikovs in Hide section in list report   
    Add a header to your page and use the code below:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> Add HTML Block above all the elements that needs be hidden, uncheck HTML Editor in advanced tab and use the code below to create buttons and start the block that needs to be hidden
    <input type="button" href="#" id="s[@field:ID]" Value="Show" /> <div id="b[@field:ID]"> <input type="button" href="#" id="h[@field:ID]" Value="Hide" /> At the end of the elements add another HTML Block, uncheck HTML Editor and paste this code
    </div> <script> $(document).ready(function(){ $('#b[@field:ID]').hide(); $('#h[@field:ID]').click( function (){$('#b[@field:ID]').hide();$('#s[@field:ID]').show();}); $('#s[@field:ID]').click( function (){$('#b[@field:ID]').show(); $('#s[@field:ID]').hide();}); }); </script>  
    Note [@ID] in this code needs to be replaced with the unique ID you have in your table source.
  19. Thanks
    MayMusic got a reaction from Master in Take photo   
    Add a Footer to Configure Fields screen and click on Source button to paste this code
    <script> var myInput = document.getElementById('InsertRecordPicture'); function sendPic() { var file = myInput.files[0]; } myInput.addEventListener('change', sendPic, false); </script> Picture needs to be changed to the file field name.
  20. Like
    MayMusic got a reaction from telepet in Grid edit by default   
    You can try to change the style to:
    <style> .cbGridCtnr > .BodyCtnr > .Table{ width: auto; } .cbGridCtnr > .HeadCtnr > .Table { width: auto; } </style>  
     
  21. Like
    MayMusic got a reaction from subraasingapore in Hiding columns including aggregation rows in Datapage   
    I cannot replicate this issue I used the code just instead of
    nth-of-type(2)   I have
    nth-of-type(1) and it is hiding the aggregation as well. What is the URL to your page?
  22. Like
    MayMusic got a reaction from karikounkel in Select multiple values from a listbox in a update DataPage   
    If you have more than one listboxes on your details or update user this code
    <script> // Function for selecting corresponding elements from the list box. function select_ (){ // get listbox element var o_els = new Array("EditRecordFIELDNAME","EditRecordFIELDNAME2","EditRecordFIELDNAME3"); for (var k=0; k< o_els.length; k++ ) { var o_el = document.getElementById(o_els[k]); // Enable multiselect for listbox o_el.multiple="multiple"; // get listbox length var len = o_el.options.length; // get selected element var selected = o_el.options[len-1].value; // verify if selected element contains comas, if yes, do the following if (selected.indexOf(",") != -1 ){ // Split selected option into array var m_array = new Array();m_array=selected.split (","); // Delete last option from the listbox o_el.options.remove(len-1); // Go through listbox and select each option, if it is present in array for( var i=0; i< m_array.length; i++ ){for( var j=0; j< len-1; j++ ){ // Trim spaces while comparing elements from array and listbox if( m_array[i].replace(/^s+|s+$/g, '') == o_el.options[j].value ){ o_el.options[j].selected = "selected"; } } } } } } // call select_ funtion when details page is loaded window.onload = select_; </script>
  23. Like
    MayMusic got a reaction from lmooring in Change A Form Field Value On Submit   
    You can have a script that calls a function on submit to check the box
    <script> document.getElementById('caspioform').onsubmit = function (){ document.getElementById('CHECKBOXID').checked="True"; } </script> Code can go to the footer of the page and "CHECKBOXID" needs to be replaced with actual element ID.
  24. Like
    MayMusic got a reaction from MBhalli in Changing Background color of a radio button   
    The ID of a radio button does not seem to be correct. Refer to
    It should be something like, InsertRecordMetalic_Injury0, InsertRecordMetalic_Injury1 ....
    Also you do not need == true
     
    <script type= "text/javascript"> function ValueChanged() { alert("Function Called"); if(document.getElementById("InsertRecordMetalic_Injury0").checked){ document.getElementById("InsertRecordPrior_Surgery0")0.style.background = "yellow"; } document.getElementById("InsertRecordPhone").focus(); } document.getElementById("InsertRecordPrior_Surgery0").onclick= ValueChanged; </script> But I am not sure how to change the background color
  25. Like
    MayMusic got a reaction from TWIRED in Select multiple values from a listbox in a update DataPage   
    If you have more than one listboxes on your details or update user this code
    <script> // Function for selecting corresponding elements from the list box. function select_ (){ // get listbox element var o_els = new Array("EditRecordFIELDNAME","EditRecordFIELDNAME2","EditRecordFIELDNAME3"); for (var k=0; k< o_els.length; k++ ) { var o_el = document.getElementById(o_els[k]); // Enable multiselect for listbox o_el.multiple="multiple"; // get listbox length var len = o_el.options.length; // get selected element var selected = o_el.options[len-1].value; // verify if selected element contains comas, if yes, do the following if (selected.indexOf(",") != -1 ){ // Split selected option into array var m_array = new Array();m_array=selected.split (","); // Delete last option from the listbox o_el.options.remove(len-1); // Go through listbox and select each option, if it is present in array for( var i=0; i< m_array.length; i++ ){for( var j=0; j< len-1; j++ ){ // Trim spaces while comparing elements from array and listbox if( m_array[i].replace(/^s+|s+$/g, '') == o_el.options[j].value ){ o_el.options[j].selected = "selected"; } } } } } } // call select_ funtion when details page is loaded window.onload = select_; </script>
×
×
  • Create New...