Jump to content

bahar_vm

Caspio Rockstar
  • Posts

    546
  • Joined

  • Last visited

  • Days Won

    7

Community Answers

  1. bahar_vm's post in How Do I Timestamp A Record When Value Of A Checkbox Is Changed? was marked as the answer   
    Place the script below in the Footer of your details/update page.
    Status is my checkbox field. Change Status in the code to your field name.
    Time_status_edited is a hidden field to store the timestamp. Change Time_status_edited to your field name.
    ---------------------------------------------------------------
    function getT()
    {
    var prevValue='[@field:Status]';

    if(((prevValue!= 'Yes') && (document.getElementById("EditRecordStatus").checked)) || ((prevValue== 'Yes') && (!document.getElementById("EditRecordStatus").checked)))

     {
       document.getElementById("EditRecordTime_status_edited").value = '[@cb:Timestamp]';
      }
    }
    document.getElementById("caspioform").onsubmit = getT;

    </script>
     
  2. bahar_vm's post in time stamp field based on selection in drop down? was marked as the answer   
    The script below records date/time (timestamps) when a specific field (in my case Status field) is updated. You don't need any virtual field. Place the script in the Footer of your details/update page.
    Status is my dropdown field (it could be a text field as well). Time_status_edited is a hidden field to store the timestamp upon updating the Status field. <script type= "text/javascript"> function getT() { var prevValue='[@field:Status]'; if(document.getElementById("EditRecordStatus").value != prevValue) { document.getElementById("EditRecordTime_status_edited").value = '[@cb:Timestamp]'; } } document.getElementById("caspioform").onsubmit = getT; </script>
  3. bahar_vm's post in Keyword Search in Search & Report Data Page was marked as the answer   
    There is an article about how to accomplish keyword search in a report, visit the article here: http://howto.caspio.com/faq/reports-datapages/how-to-do-keyword-search-across-multiple-fields/.
  4. bahar_vm's post in Online Users was marked as the answer   
    Hi, User logs feature has been built in the product long time ago. Find more information about it here: http://howto.caspio.com/authentications-and-connections/users-log/
     
    Best,
    Emma
  5. bahar_vm's post in Submission Form Datapage - Email Acknowledgement Not Working was marked as the answer   
    Hi Mike,
     
    To clarify, this is a known issue since Notification/Acknowledgement emails in a submission form only have access to the values that were actually inserted and they do not have access to the other values via view. We suggest using Details DataPage, which you already did:), where emails have access to all fields of the current record. If it has to be a submission form based on multi-table view, then a workaround is to redirect to a Details DP which sends the email and auto-submit using JS.
     
    ~ Emma
  6. bahar_vm's post in Refresh Parent Window After Closing A Popup Window was marked as the answer   
    One reason is the security restrictions since parent and child windows have different domain names. This happens if the parent/opener DataPage is embedded in your domain (yousite.com) and the popup DataPage (the one which is auto submitted) is called by direct URL (bn.caspio.com).
     
    To fix the issue, deploy the popup DataPage (the one which is auto submitted) on same domain as the opener and then use the following code in Destination and Triggers screen inside Display a Message text/HTML area:
    <script> window.close(); window.onunload = function(){ window.opener.location.reload();} </script>
  7. bahar_vm's post in Placeholder In Text Field was marked as the answer   
    Bjorn,
     
    I think this article will help you to accomplish this:
     
    http://howto.caspio.com/customization/interface/add-auto-clearing-sample-text-to-text-fields-and-text-areas.html
     
    Best,
    Emma
  8. bahar_vm's post in Center datapages was marked as the answer   
    The easier solution does not need a JavaScript. Just place the following code in the header of the DataPage:
     
    <style>
    table {
    margin: 0 auto ;
    }
    </style>
  9. bahar_vm's post in Passing Paramaters Containing Amperand (&) was marked as the answer   
    How about the following, I've tested this one and should work:

    <script> var v_name = "[@field:Mailing_Names]" ; v_name = v_name.replace(/&/gi,'&'); document.write("[url="http://b6.caspio.com/dp.asp?AppKey=ddae2000c2f0bb5fd8424eba8ca5&Mailing_Names="]link[/url]") ; </script>
  10. bahar_vm's post in Enable multiple selection for listbox with virtual fields was marked as the answer   
    Here is the solution to implement listbox on search (submission) form as virtual field to function as multi-selection and pass the selected options separated by OR to the results filtering.
     
    Requirements:
     
    The list box is a virtual field, in our example: "cbParamVirtual1"
     
    An additional virtual field, in our example "cbParamVirtual2", is needed to store the OR separated string and pass to the next page (results page). You can make this virtual field "hidden" since it is only neccessary for the program and not human use.
     
    Adjust the script if you have more or less listboxes in your search form. The virtual field ID also should be adjusted accordingly; you can find the ID using Firebug and adjust the X in "cbParamVirtualX".
     
    The script goes to the footer of the Search/Submission DataPage "Configure Fields" wizard screen. 
     


    <script type="text/javascript">
       var fieldName = "cbParamVirtual1";


       var x1=document.getElementsByName(fieldName);
       x1[0].multiple=true;


    function splitAndParse()
    {
    var result = "";
    var cleanResult = "";
    for (var i = 0; i < x1[0].length; i++) { 
    if (x1[0].options[i].selected) { 
    result += "\""+x1[0].options[i].value+"\"" + " OR " ;


    if (x1[0].length > 4) { cleanResult = result.substring(0,(result.length-4)); }
    document.getElementById("cbParamVirtual2").value = cleanResult;


    }


    document.getElementById("caspioform").onsubmit=splitAndParse;
    </script>
  11. bahar_vm's post in JavaScript getElementsByName, cascading drop box problem was marked as the answer   
    Final update on this. I cleaned the script as seen below:

    <script type="text/javascript"> var form = document.getElementById('caspioform'); form.onsubmit = function() { var o_Cust1 = document.getElementsByName("InsertRecordCompany"); var o_CustNew = document.getElementById("InsertRecordNew"); if(o_Cust1[0].options[o_Cust1[0].selectedIndex].text == "Add New Company") { o_Cust1[0].options[o_Cust1[0].selectedIndex].text = o_CustNew.value; } } </script> However programmatic wise it does work because you can not assign a value to a pre-selected option in a dropdown (last line). There is an easier way to achieve this, please go over this article which shows how to add a new option to a dropdown, http://howto.caspio.com/tech-tips/tech- ... boxes.html.
    If you still insist on using a JavaScript I suggest if you use a hidden field for the company field on the web form and use a virtual field for the cascading dropdown to list the company names. In this case however you need to reference the virtual field as "cbParamVirtual1".
    Best,
    Bahar M.
×
×
  • Create New...