Jump to content

Jan

Caspio Evangelist
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    35

Community Answers

  1. Jan's post in Disable A Form For Wrong Entry was marked as the answer   
    Hi bookish,
     
    Please change "InsertRecord" to "EditRecord" in the line:
    var text_for_checking = document.getElementById("EditRecordtext").value; You can read Details in the Guide.
    I hope, it helps!
  2. Jan's post in Grid Edit As Default was marked as the answer   
    Hello Olivier,
     
    Welcome to Caspio Forum!   
     
    I think, you can use the following Java Script code (you can add Header&Footer element to the Result Page of your DataPage, select the Footer element, click the "Source" button and enter the code):
    <script type="text/javascript">function f_dispatchEvent(v_element, v_type){  ///<summary></summary>  ///<param name="v_element" type="HTMLElement"></param>  ///<param name="v_type" type="String"></param>  if(v_element.dispatchEvent) {   //var v_e = new Event(v_type);   var v_e = document.createEvent('MouseEvents');   v_e.initEvent(v_type, true, true);   v_element.dispatchEvent(v_e); //new Event(v_type, {"bubbles":true, "cancelable":true})  } else if(v_element.fireEvent){   v_element.fireEvent('on' + v_type);  } }; setTimeout(function(){  var v_element = document.getElementsByName("GridEditButton")[0]; f_dispatchEvent(v_element, "click"); }, 5); </script> I hope, it helps.
     
    Also you can add your idea to the Ideabox. From my point of view, it is a very good idea.
  3. Jan's post in How Do I Select A Date In One Field And Have All Subsequent Date Fields Fill In Automagically was marked as the answer   
    Hello Dilts,
     
    You can find the code for 10 fields that are auto-filled with next business day. You can easily change it to 5 fields.
     
    If you need every next day (I mean, Saturdays and Sundays too) you can use the following code:
    <SCRIPT LANGUAGE="JavaScript"> function nextDate(baseDate) {      var base_day = baseDate.getDate();      base_day = base_day + 1;      var next_Date = new Date (baseDate.setDate(base_day));      var week_day = next_Date.getDay(); return next_Date; } function setFormat(next_Date) {      var d_month = next_Date.getMonth() + 1;      if (d_month<10) {d_month = "0" + d_month;}      var d_day = next_Date.getDate();      if (d_day<10) {d_day = "0" + d_day;}      var d_year = next_Date.getFullYear();      var str_date = d_month + "/" +  d_day + "/" + d_year; return str_date; } function setDates() {      var f_Date = document.getElementById("InsertRecordfield1").value;      var first_Date = new Date(Date.parse(f_Date));      var second_date = new Date (nextDate(first_Date));      document.getElementById("InsertRecordfield2").value=setFormat(second_date);      var third_date = new Date (nextDate(second_date));      document.getElementById("InsertRecordfield3").value=setFormat(third_date);      var forth_date = new Date (nextDate(third_date));      document.getElementById("InsertRecordfield4").value=setFormat(forth_date);      var fifth_date = new Date (nextDate(forth_date));      document.getElementById("InsertRecordfield5").value=setFormat(fifth_date); }  document.getElementById("InsertRecordfield1").onchange=setDates;   </SCRIPT> Please, enter names of your fields instead of field1, field2, field3, field4, field5.   I hope, it helps.
  4. Jan's post in How To Import Bulk Records That Use Unique Or System Generated Fields was marked as the answer   
    Hi Rishiforum,
     
    If I understand correctly, you have fields in your table, that are selected as "Unique". As far as I know, if this option is selected, in the section below you can specify if blank values are allowed. You can edit your table and allow blank values.   I hope, it helps.
  5. Jan's post in Resetting Virtual Fields With Button? was marked as the answer   
    Hello DataCobalt,
     
    I am not sure that I have found the best solution, but it seems, it works.
     
    You can use two Java Scripts.
    Add the following code to the Header of your DataPage:
    <SCRIPT LANGUAGE="JavaScript"> var site_URL = "URL_OF_YOUR_PAGE"; var is_it_reset = window.location.search; if (is_it_reset.indexOf("cbResetParam") > -1) { window.location = site_URL; } </SCRIPT> Please insert the correct URL of your site in format http://mysite.com
    And add the following code to the HTML block where the Reset button will be displayed:
    <input type="reset" value="Reset" id="reset_button"> <SCRIPT LANGUAGE="JavaScript"> function reset_data() { var site_URL = "URL_OF_YOUR_PAGE" + "?cbResetParam=1"; window.location = site_URL; } document.getElementById("reset_button").onclick=reset_data; </SCRIPT> Please insert the correct URL and make sure, that the correct sign is used in the "?cbResetParam=1"
    If parameters are used in your URL, it means, the "?" sign already present in the URL, then "&cbResetParam=1"
    If no parameters and no "&" signs is used, then "?cbResetParam=1"
     
    I hope, it helps!
  6. Jan's post in Javascript For Onchange For Ten Days Ago was marked as the answer   
    Hello DataCobalt,
     
    If I understand you correctly, you can use the following code:
    <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual1").value=='Recent (Within the last 10 days)')    {    var nDate = new Date();    var new_date = new Date(nDate.setDate(nDate.getDate()-10));    var d_month = new_date.getMonth() + 1;    if (d_month<10) {d_month = "0" + d_month;}    var d_day = new_date.getDate();    if (d_day<10) {d_day = "0" + d_day;}    var d_year = new_date.getFullYear();    var str_date = d_month + "/" +  d_day + "/" + d_year;    document.getElementById("cbParamVirtual2").value=str_date;        } else {document.getElementById("cbParamVirtual2").value="";} } document.getElementById("cbParamVirtual1").onchange=ocPredefinedReports; </SCRIPT> Does it work for you?
  7. Jan's post in Trouble With Combining Fields was marked as the answer   
    Hello DataCobalt,
     
    Then you can add two symbols to your JavaScrit:
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Employee_First_Name = document.getElementById("InsertRecordEmployee_First_Name").value; var Employee_Last_Name = document.getElementById("InsertRecordEmployee_Last_Name").value; var Employee_ID = document.getElementById("InsertRecordEmployee_ID").value; var Employee_Selector = Employee_Last_Name + ", " + Employee_First_Name + " - " + Employee_ID; document.getElementById("InsertRecordEmployee_Selector").value = Employee_Selector; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> If the Script code does not work, could you please provide the URL of your page or FoemElements of every field?
  8. Jan's post in Measure Data Usage And Storage was marked as the answer   
    Hello Chad,
     
    As far as I know, Data Transfer is measured by day. Maybe, you can ask for some additional programming.
     
    Do you have the "User Log" feature in your account?
    I am not sure, if it works for you, but you can follow the next steps:
     
    1) Create Authentications for every DataPage.
    1a) Every Authentication uses the same table.
    1b) On every Authentication, "Enable auto-login" is checked.
    It allows a user to enter credentials one time and then go through all DataPages without any additional log ins.
    1c) Authentications are named by DataPages.
     
    Now User Log contains information like:
    26 Jan 2015 05:33 PM user1 DP third 26 Jan 2015 05:33 PM user2 DP First 26 Jan 2015 05:32 PM user1 DP second 26 Jan 2015 05:30 PM user1  DP First   Maybe it helps.
  9. Jan's post in Sites - Connection Problems was marked as the answer   
    Hello Chad,
     
    Maybe some settings on your site cause the issue.
    Can you please to test your FTP Connection with, for example, https://ftptest.net/ ?
  10. Jan's post in Move Submit Button In-Line With Text Fields? was marked as the answer   
    Hello DataCobalt,
     
    It seems, the simplest way is to copy the class to head of your webpage.
    The code of the webpage will be like:
    <HTML> <head> <style> .cbSubmitButton { /*Submit Button Attributes*/ The code of the class from the Style } </style> </head> <body> The code of an embedded DataPage </body> </html> Does it work for you?
  11. Jan's post in Format On Display was marked as the answer   
    Hello CHAD,
     
    There is a Java Script solution for Submission Forms.
     
    But I am afraid, I do not understand clearly what is your goal.
  12. Jan's post in Multi-Layer Relationship was marked as the answer   
    Hello CHAD,
     
    I am afraid, that the best way is to use three tables Users.
    You can use Scheduled Tasks to export the Base of three tables and then Import it two times to replace the second and the third tables.
     
    As far as I know, many-to-many relations do not work now in Caspio.
     
    But maybe there is a better solution.
  13. Jan's post in Pass Parameter To Deteils Report, Using Url Deployment Method was marked as the answer   
    Hi Uwe,
     
     
    It seems, I found the reason.
    The correct URL is
    http://eu1.caspio.com/dp.asp?AppKey=54ac3000213663dc7f704ca39391&pid=2
     
    Only one "?" is allowed in the URl, it begins the list of parameters. Between parameters "&" is used instead of "?".
     
    I hope, it helps.
  14. Jan's post in Reasons For Parameters Not Being Passed From Multi Select Listboxes In Submission Form was marked as the answer   
    Hi Jay,
     
    I have found the reason.
    The line
    if (x5[0].length > 4) { cleanResult5 = result5.substring(0,(result5.length-4)); } Defines that value will be passed only if the Listbox contains 5 and more items.
    My listboxes contained 5 and more items and the Script worked. I changed them to 4 items - and your issue reproduced.
     
    You can change all lines to
    if (x5[0].length > 0) { cleanResult5 = result5.substring(0,(result5.length-4)); } Change "4" to "0" after "(x5[0].length >"
     
    I have tested with this new value. It works on my DataPage.
     
    I hope, it helps.
  15. Jan's post in Wordpress Issue With Default Borders Or Outlines Showing Up, Is This An Issue With All Wordpress Caspio Sites? was marked as the answer   
    Hi m2367,
     
    Can you edit the "Style.css" file? Its relative url from
     
    If I understand correctly, you can find the ".entry-content table" class and change the 
    .entry-content table { border: 1px solid #eee; margin: 0 0 15px 0; text-align: left; width: 100%; }
    to
    .entry-content table { border: 0px solid #eee; margin: 0 0 15px 0; text-align: left; width: 100%; }
     
    I hope, it helps.
  16. Jan's post in Multi-Select List Box In Submission Form was marked as the answer   
    Hi,
     
    I hope, you can find the answer in this topic.
  17. Jan's post in Automatically Insert Username Into Field was marked as the answer   
    Hi Ant,
     
    You can try the following steps:
    - add a Virtual field to your page, select Hidden in the "Form Element" field, select Authentication Fields and your field in the "On load assign" fields;
    - add a Header&Footer element and add the following code to the Footer:
    <SCRIPT LANGUAGE="JavaScript"> function insert_username() { var auth_username = document.getElementById("cbParamVirtual1").value; document.getElementById("EditRecordusername").value = auth_username; } document.getElementById("caspioform").onsubmit=insert_username; </SCRIPT> Please insert the number of your Virtual Field instead of 1 in "cbParamVirtual1" and the name of your field instead of "username" in "EditRecordusername".
    The username will be inserted, when the user clicks the "Submit" button.   I hope, it helps.
  18. Jan's post in Checkbox Javascript Toggle was marked as the answer   
    Hello sddenrweb,
     
    I think, you can try the following code:
    <script type="text/javascript"> function turnOffMix() { if (document.getElementById("InsertRecordmix").checked) { document.getElementById("InsertRecordmix").checked = false; } } function turnOffPure() { if (document.getElementById("InsertRecordpure").checked) { document.getElementById("InsertRecordpure").checked = false; } } document.getElementById("InsertRecordpure").onchange=turnOffMix; document.getElementById("InsertRecordmix").onchange=turnOffPure; </script>
  19. Jan's post in Child Form On Same Page As Parent Submission Form was marked as the answer   
    Hello gcbauer,
     
    If I understand correctly, you want to reset parameters. Just add a link to the Header of a DataPage like 
    <a href="http://www.yourdomain.com?cbResetParam=1">New Search</a> You can find instructions in this article.
  20. Jan's post in Passing Value From Results Page Without Using Query String? was marked as the answer   
    If I understand correctly, you can use AutoSubmit on Deatils page of your Results DataPage.
    The idea is: a user clicks "View Details" on the Results DataPage, Details page is auto submitted and send parameters to "truly" Details DataPage.
     
    Please follow the next steps:
    On the Results DataPage, go to Details page and add fields that you want to pass as parameters, and then check "On Exit Pass field value as parameter" check-boxes for every of them.
    Select for any field Form Element "Text Field", it allows you to select "Go to a DataPage" on the Destination page.
    Then add Header and Footer element, add to Header the following code:
    <div align="center"> <p>Processing...</p> </div> And add to the Footer the following code
    <br /> <script type="text/javascript">   if(document.getElementById("caspioform")) {   document.getElementById("caspioform").style.display = 'none'; document.getElementById("Mod0EditRecord").focus;   setTimeout('document.forms["caspioform"].submit()',1000); }  </script> On the Destination page select "Go to a DataPage" and select your Details DataPage. If you use embedded DataPages, select "Go to a new page" and enter the address of the page, where your Details DataPages is deployed.
     
    I hope, it helps.
  21. Jan's post in Conditional Background Color Change was marked as the answer   
    Hi senicholas,
    If you use a Report DataPage, I hope the following JavaScript can help:
    <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); for (var i=0, m=elems.length; i<m; i++) { if (elems[i].innerHTML>7) { elems[i].style.color="red";} } </SCRIPT> The code checks all valaues and make the color "red", if the value is more than 7.
  22. Jan's post in Missing Required Field Error (Urgent) was marked as the answer   
    Hello ecortezneavel,
     
    It is strange.
     
    It seems, you can "repair" the problem:
    1) Open Configure Search Form step.
    2) Copy the text from your HTML block.
    3) Create a new HTML block.
    4) Paste the copied text to this new HTML block.
    5) Delete the old HTML block.
    If you have more than one HTML block, repeat steps 2-5 for all blocks.
     
    Now a DataPage works correctly.
  23. Jan's post in Bullets In Text Box was marked as the answer   
    I am sorry, this alert allows me to check that tags are inserted.
    Please try this code:
    <SCRIPT LANGUAGE="JavaScript"> function textReplace() { var text = document.getElementById("InsertRecordtest1").value; text = text.replace(/\n/g, "</li>\n<br/><li>"); text = "<ul><br/><li>"+text+"</li></ul>"; document.getElementById("InsertRecordtest2").value = text; } document.getElementById("caspioform").onsubmit=textReplace; </SCRIPT>
  24. Jan's post in How To Make A Poll Report? was marked as the answer   
    Hello Mel,
     
    As far as I know, you can add the data to two and more 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. On the second DataPage you can use an auto-submit DataPage.
    Then you can create a Chart DataPage that uses this second table.
     
    Does it work for you?
  25. Jan's post in Calculated Dates Precision was marked as the answer   
    Hello EIQ,
     
    Please, try
    Datediff(minute,[@field:LoginDT],[@field:LogoutDT])/60.00
     
    As far as I know, Calculated Fields try to display result in the DataType that are used in calculations. For example, you divide by "60" - and the Result is Integer. If I understand correctly, if you divide by "60.00" - Result will be General, like 0.25.
    By the Formatting button you can define how many digits after decimal will be displayed.
×
×
  • Create New...