Jump to content

Jan

Caspio Evangelist
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Jan

  1. Hi Barbara, Please do not forget the "<script>" before the code. The whole code will be: <script> 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. Hello Neil, I think, it is possible. The general schema is: 1) There is a field "Last visit" in an authentication table. 2) When a user logs in, the value of the field is "remembered" and a new, current value is saved. 3) The user is redirected to the DataPage that uses the "Content" table as a DataSource, and the remembered value of "Last visit" is passed as a parameter. On the DataPage a pre-defined search is enabled and the data is filtered by the parameter and Comparison type "Greater Than". 4) A JavaScript code checks, if the message "No records found" is displayed. If yes, the DataPage is hidden and the user is redirected to the next page without any messages. If a record is found, the DataPage is displayed or it is opened in a pop-up window. It seems, it should work.
  3. Hello kathysoup, As far as I know, you cannot run scripts from tables for security reasons. But you can use the data from fields as values of variables. Also you can add several scripts to the Footer and run one of them depend on the value of a field. I hope, it helps.
  4. Hello james1234, I have added a Rule to disable field2 - field9 (you can create a new section, move the fields to this section, then add a Rule with the "Value = 1 equal Value = 1" Condition and the "disable the section" Action). I hope the following code helps: <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(); if (week_day==0) { base_day = base_day + 1; var next_Date2 = new Date (next_Date.setDate(base_day)); } if (week_day==6) { base_day = base_day + 2; var next_Date2 = new Date (next_Date.setDate(base_day)); } 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); var sixth_date = new Date (nextDate(fifth_date)); document.getElementById("InsertRecordfield6").value=setFormat(sixth_date); var seventh_date = new Date (nextDate(sixth_date)); document.getElementById("InsertRecordfield7").value=setFormat(seventh_date); var eights_date = new Date (nextDate(seventh_date)); document.getElementById("InsertRecordfield8").value=setFormat(eights_date); var ninth_date = new Date (nextDate(eights_date)); document.getElementById("InsertRecordfield9").value=setFormat(ninth_date); } document.getElementById("InsertRecordfield1").onchange=setDates; </SCRIPT> Please insert names of your fields instead of field1-field9.
  5. Hi iren, You can create a Virtual field and select Hidden Form element. In Field Options of the Virtual field, select Data Source Fields and your field (for example, Status). This Virtual field will "remember" the initial value of the field. Then add a Header&Footer element, select Footer, click Source and enter the following code: <script type= "text/javascript"> function getT() { if(document.getElementById("EditRecordStatus").value != document.getElementById("cbParamVirtual1").value) { document.getElementById("EditRecordTime_edited").value = '[@cb:Timestamp]'; } } document.getElementById("caspioform").onsubmit = getT; </script> Enter names of your fields instead of Status and Time_edited and change the number of the Virtual field in cbParamVirtual1, if the added Virtual field is not the first. Also make the Time_edited field hidden in the details/update form because you don't want user to be able to update it. I hope, it helps.
  6. You are very welcome! And I am glad that the problem is resolved.
  7. Hi AdamH, If I understand correctly, you can add one more field, set DateType as Timestamp, in Additional Field Options check "Stamp On Update" and uncheck "Stamp On Insert". Then you can check if this field empty - and if it is empty, then auto-submit the form via Javascript. But it requires one more field, so your solution is probably better.
  8. Hello james1234, If I understand correctly, 1 business day means, that if the previous day is Friday, the next day should by Monday. Is it correct?
  9. Hi AdamH, If I understand correctly, it is possible, if you use two DataPages and redirect. The first DataPage remembers the Timestamp date&time, when a user opens the DataPage. Then a user enters his data to Virtual fields, and when the user clicks "Update", this data and the Timestamp date&time is passed to the second DataPage. Here two Timestamps are compared, and if the Timestamp of the first DataPage is equal to the Timestamp of the second DataPage, the data is edited. Else the message is displayed. I hope I will post the more detailed instructions and the Java Script code soon.
  10. Hi Chad, As far as I know, Caspio uses Passive mode. If I understand correctly, Caspio uses the EPSV command to open the Passive mode, if it does not work, then the PASV command is used. Can you check, if EPSV works on your server?
  11. 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/ ?
  12. Hi bookish, Can you use drop-down lists instead of input fields? You can use Lookup tables with variants of special diets and special room requests. You can look for some words in the field with the following code: <SCRIPT LANGUAGE="JavaScript"> function check_text() { var text_for_checking = document.getElementById("InsertRecordtext").value; var wrong_answer = false; if (text_for_checking.search("room")!=-1) {wrong_answer = true}; if (text_for_checking.search("floor")!=-1) {wrong_answer = true}; if (wrong_answer) { alert("Please specify your diet requirement."); return false; } } document.getElementById("caspioform").onsubmit=check_text; </SCRIPT> Please, enter the name of your field instead of text in the var text_for_checking = document.getElementById("InsertRecordtext").value; You can add as many words as you wish, just copy the line if (text_for_checking.search("room")!=-1) {wrong_answer = true}; and enter your word instead of "room". To use a Java Script code, please add a Header&Footer element, select the Footer element, then click the Source button, and then enter a code. I hope it helps.
  13. Hi oceaim, Do you have lines from steps b and a on the webpage in the correct order? Is it the name of the field "Signature"? You can delete the "[@field:Signature]" and insert the parameter with the parameter picker instead of the code. Could you provide the URL of your page?
  14. Maybe, somebody else looks for the solution how to display a Signature. It is rather simple: Do steps a ) and b ) from the article. Add an HTML Block to your DataPage, click the "Source" button and enter the following code: <div class="sigPad"> <canvas class="pad" width="220" height="55"></canvas> </div> <script> var sig = [@field:Signature]; var api = $('.sigPad').signaturePad({displayOnly:true}); api.regenerate(sig); </script> Please enter the name of your field instead of "Signature". I hope, it will be useful.
  15. 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?
  16. Also you can use a condition. For example, you can use the following code to hide the button, if a Virtual field 1 contains any value: <script> var check_field = document.getElementById("cbParamVirtual1").value; if (check_field) { document.getElementById("Submit").style.display = "none"; } </script>
  17. Hello Elena, I am glad to see you again If I understand correctly, you can select "None" in the "Time out and redirection", and select "Same page" in the "Login redirection on success" of the "Advanced Settings" section of your Authentication. Then the same page will be opened after log in. Does it work for you?
  18. Hi Mark, As far as I know, you can create a View and use it as a DataSource. You can find instructions in this article. I hope, it helps.
  19. Hi pgjacob, I am glad that my suggestion is useful. I am sorry, it was a misprint: var link_text="[@field:FIELDNAME/]"; The "/" should be added after the fieldname. For example, [@field:file1/] I think, the better way to change the size of the image is to use another image or edit the existing one. Also you can define the size of the displayed icon if you change the code: var image_to_display='<a href="' + link_text + '"><img src="' + src_address + '" width="40" height="40"></a>'; You can set your values of the width and height, the size is in pixels.
  20. Hello ccarls3, Please make sure, that your code in the Header section is: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.7/jquery.floatThead.min.js"></script> <div id='cb_lib'> There is a Note in instructions: To use "iframe deploy code" or "direct from Caspio link", place the above script in the HTML Header section of the Configure Results Page Fields of the DataPage using the Caspio Bridge DataPage Wizard. On my DataPage, the Headers are Freezed, when I scroll the height of the frame, not of the whole page. I hope, it helps.
  21. Hello kfeeney16, As far as I know, yes, it is the better solution: to create a copy of the table. You can create Scheduled Tasks: to export the first table and to import it as the second table. I hope, it helps.
  22. Hi all, I want to share what I have found. I have files in my table, and I wanted to display an image instead of text links for downloading files. So, I have written the following Java Script code, added an HTML Block to my Results Page and entered the code (please do not forget to click the "Source" button): <script> var link_text="[@field:FIELDNAME/]"; var src_address="URL"; var image_to_display='<a href="' + link_text + '"><img src="' + src_address + '"></a>'; if (link_text.length>0) { document.write(image_to_display); } </script> You can enter the name of your field instead of "FIELDNAME" and your image URL instead of "URL" (e.g., https://mysite.com/images/download.png) I hope, it will be useful.
  23. Hello DataCobalt, If I understand correctly, you can create an HTML block, click the Source button and enter the following code: <input id="Submit" name="Submit" class="cbSubmitButton" onmouseover="cbButtonHover(this,'cbSubmitButton_hover');" onmouseout="cbButtonHover(this,'cbSubmitButton');" value="Submit" type="submit"> Then the "Submit" button will be displayed in this block. To hide the second button, you can add to ".cbSubmitButtonContainer" class the following line: display:none; I hope, it helps. Happy New Year!
×
×
  • Create New...