Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Caspio Bridge
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL






  1. Hi, I have an html page with 2 datapages in it. Both are in their own divs. I'm trying to get the second div, called 'callback', to refresh every 6 seconds. I don't want to refresh the first div. I've got this javascript to do it function autoRefresh_div() { $("#callback").load("https://c1eru548.caspio.com/dp.asp?AppKey=f6344000919808bbf8fb4bb59cec&Email=[@authfield:Email]&Current_Password=[@authfield:Current_Password]"); } setInterval('autoRefresh_div()', 6000); The URL in the function autoRefresh_div is the deployment URL from Caspio for the datapage I want refreshing. Users lo
  2. I learned how to duplicate a record from a DataPage into a table using sub-query strings, hidden pages and auto-submit. The only thing I was not able to duplicate was the record picture. Any one knows how to do that? Sincerely, JaredL
  3. I have a javascript code I got off of this forum that takes an inputted ten digit number and adds formatting (ie 1234567891 gets changed to (123) 456-7891). I have a field that will always be ######-###### and I'd like to modify the code to add the dash in the middle. What I'm trying to avoid is having someone needing to click on multiple boxes to fill out the entire field. I'm not great with javascript, so I was hoping someone on here would be able to help me with that. Here is the code: <SCRIPT LANGUAGE="JavaScript"> function f_a(v_id) { return document.getElementById
  4. Is it possible to hide entire rows of data in a tabular results page based on a Calculated field Value using JS? Essentially, I have a search and report to return records based on predefined criteria. However, one criteria that I would like to filter by is not stored directly in the table (Table A). It is stored in another table (table B ). So I have a calculated field holding a SQL Query to return a number based on the records from the other table (table B ). I would like to then see if there is a way to hide all records returned that are returned with a Value of 0 from the Table A Tabula
  5. Hi all, I want to hide the submit button in a details page based on the value of five calculated fields. I saw this post from before: http://forums.caspio.com/index.php/topic/5131-hide-button-based-on-calculated-field/ Based on the advice there, I came up with the following: <script language="javascript"> var stat='[@calcfield:2]'; if (stat.length='Not Equal, please revise figures') { coauthor = stat; document.write(stat); document.getElementById("Mod0EditRecord").style.display = "none"; } </script> But I have been unable to get that script to work for me properly.
  6. I have a subscription form that is using a virtual radio button field (field: Virutal7) to force subscribers into choosing one of two versions. If the user clicks on the second option (Community Bank Version) I would like to update a hidden checkbox field (field: CBVer) with a check to track the version in our database. I am using the radio button so I can make the choice of a version a required field. I wrote the following JS to attempt to switch the checkbox when the user selects the second option, but to no avail. If anyone could take a look at this I would greatly appreciate it. Sa
  7. I'm using a details page to update a record in my table & on the details page are a variety of calculations that i've written to calculate "onchange" on the page. Things are working properly, however now i'd like to disable the sumbit button if "Field_A" & "Field_B" do not match. To add a layer to this, i'd like to know how to use an HTML block as one of these fields since it's where the calculation happens and i'd also like to know if i can have multiple criteria that disable the submit button. I'm thinking that I need to assign a field name to the HTML block, however I don't know
  8. I need to be able to tell this code to display as a currency at times instead of just a value. This code is adding up a few different cells when the user changes cells. Can you let me know where in the code that should be added? Thanks so much! <div id="mypage"> </div> <SCRIPT LANGUAGE="JavaScript"> function calculate() { var Settle_ADV_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)))? 0 :(parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)); var Settle_DOS_Gross = isNaN((parseInt(docum
  9. Hello I am trying to perform two calculations and autosumbit the page, however only the second calculation is being performed when the page is autosubmitted. Please advise. <SCRIPT LANGUAGE="JavaScript"> function calculate() { var v_Current_Plan = parseFloat(document.getElementById("InsertRecordCurrent_Plan").value); var v_Current_Fee = parseFloat(document.getElementById("InsertRecordCurrent_Fee").value); var v_Rate= .08; var v_total = (((v_Current_Plan * v_Rate) + v_Current_Plan) - (((v_Current_Plan * v_Rate) + v_Current_Plan) * v_Current_Fee)); document.getEleme
  10. Hi there. Is it possible to condition the values of a radiobutton using Javascript? What I want to do is that, when the Data Page loads, checks if it meets a condition, and if it does, based on that is the value of the first option of my radiobutton. I haven't been able to make the first part work, and i want to make sure that works before adding the 'If' statement. Here's the code I'm currently using: <script> window.onload=function(){ document.getElementByname("InsertRecordVirtual1")[0].value="AAA"; } </script> I have also change it used "getElementById", and change the s
  11. I am trying to use an HTML block to insert script in a report to show a different hyperlink based on the condition of a field in the authorization....I tried to write and looking at it hopefully someone can help with what I am trying to accomplish: <script> if("[@field:PrioiritiesComplete^]" == "No") { window.location = "<a href="https://c0cmr504.caspio.com/dp.asp?AppKey=ExampleA?PersonID=[@authfield:PersonID#]&Email=[@authfield:Email]">Link To Complete</a> "; } else { ("[@authfield:EngagementSigned]" == "Yes") window.location = "<a href=" https://c0cmr504
  12. I have a multi-select listbox thanks to this article. The only issue is I need these items separated by ";" instead of ",". Here is the code with the changes I have made: <script type="text/javascript"> var v_state = "[@field:Reason_for_Cancelltaion]" ; var o_state = document.getElementById("EditRecordReason_for_Cancelltaion") ; o_state.multiple = true ; function f_listbox() { if ( v_state.indexOf(";") > 0 ) { for (var i=0 ; i < o_state.options.length; i++ ) { if(o_state[i].value == v_state) { o_state.remove(i); break ; } } var o_st = v_state.split("; ")
  13. ababcock

    Time Sheet

    I have multiple submission forms that need to calculate total hours based on the begin time and end time entered. The script I have entered is: <script> document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate_of_Service').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual2').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual3').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual4').value; document.g
  14. Hi there, In the App I am currently developing I have a "View Inventory" DataPage where my users can see (for a chosen product) what the starting inventory was A, how many units are reserved / shipped B and finally how many units are available C. C is a calculated field where C = A - B On this page I also have an HTML block with a control button that my users can click to create a shipment request, but I want this to be disabled when C = 0 because as it stands right now, there is nothing stopping them from ordering an item that is out of stock. The current code for my button is as follows:
  15. Hello All, Does anyone have any tricks or scripts to prevent copy/paste and right click on a DataPage. I understand that most scripts may be browser dependent, but just looking to make it a bit more difficult for users to copy things. Thanks in advance
  16. Hello Caspio Ninjas! I've noticed when the page scrolls down the Hint Popup moves an equal distance down from the element producing the hint. When scrolled down more than a few lines the Hint popup moves all the way off the screen. I just tested it in a "preview" mode, and noticed that it only happens on embedded Data Pages. I removed all of my javascript for testing, and it didn't fix it. I even removed all markup except the script for a DataPage Where would i begin trying to diagnose this problem? What might be affecting the Caspio Hint popup from my page? Thanks
  17. Hello Everyone! I have found some great answers on this forum for most of my issues but cannot find anything regarding this specific question I have. sincerely appreciate any offers of help. Currently I have a DataPage which outputs 5 text fields with a calender popup next to each (see attached img). I would like to select a date via the popup in the first field and have the subsequent fields all populate with the next day. So if you select 2/19/2015 then the output in the next data field is 2/19/2015 and so on. I believe that I can do this via some custom JS if I need to, b
  18. Hi All, Can anyone please provide a JavaScript to do the following as I have tried rules and I can’t seem to get it to work. I have a record in a data page that contains fields d1 to d10 (these are date fields) and fields et1 to et10 (hidden fields). If an authenticated user amends d1 then I want his/her username to be stored in et1. If an authenticated user amends d2 then I want his/her username to be stored in et2. If an authenticated user amends d3 then I want his/her username to be stored in et3. If an authenticated user amends d4 then I want his/her username to be stored in et4
  19. Hello all, I am currently working on a search form (using a virtual field submission form) that has a dropdown menu to select from predefined reports. The way I would like this to function is that when the user selects an option (such as "Recent (Within the Last 10 Days)") an onchange function would change the search fields to the input needed to produce those results. I am fairly new to JavaScript, here is what I have been able to get: <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual8").value=='Recent (Within t
  20. Good afternoon, I am attempting to use the Javascript posted in the solutions to combine fields. In my case I have three fields I am looking to combine. Employee_First_Name, Employee_Last_Name, and Employee_ID. The ideal formatting of this would be Lastname, Firstname - EmployeeID (For Example Smith, John - 111111) Here is the script I have that is not currently combining the fields let alone getting into the details of formatting. This is being deployed in a submission datapage. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Employee_First_Name = docum
  21. Hi, I have some script in the table that I need to be able to run on my DataPage. Can I do that? Thanks.
  22. Hi, I'm new to Caspio. I have a 9 date text fields with calendar picker. When user picks date for 1st field I need the subsequent 8 fields to populate with the 1st field's date + 1 business day. The result would be as follows: field 1 - 01/16/2015 SELECTED field 2 - 01/19/2015 AUTOPOPULATED field 3 - 01/20/2015 AUTOPOPULATED field 4 - 01/21/2015 AUTOPOPULATED field 5 - 01/22/2015 AUTOPOPULATED field 6 - 01/23/2015 AUTOPOPULATED field 7 - 01/26/2015 AUTOPOPULATED field 8 - 01/27/2015 AUTOPOPULATED field 9 - 01/28/2015 AUTOPOPULATED THEN SUBMIT* Any help, javascript and/o
  23. I have a Single Record Update form where once a user has submitted data on Record #123, I want any other users subsequently trying to update Record #123 to be "locked out" from submitting via that form. In other words, I need to be able to disable a form after it's been used once, or when Some_Field = Whatever. You could just disable it with Rules, but if 2 people arrive on the form before either has submitted, then the 2nd User rewrites over the 1st User's data. I need to prevent that from happening. Caspio Support recommends: In order to prevent the next users to submit/edit the s
  24. Hi, I have a form with 3 checkboxes. A visitor can select any checkbox to get the products they want: newspaper or magazine, both, or just one. --- The visitor can also select to get the e-newsletter, but only if the newspaper checkbox is selected. Else the e-newsletter checkbox is disabled (which is a rule set configured in the form that works fine). What I need.. is a function for if someone chooses both "newspaper" and "e-newsletter" checkboxes then decides that they don't want "newspaper" and deselect it (which leaves e-newsletter still checked). I need an onchange function that un
  25. Hello All! I am trying to figure out how to refresh an iframe from a popup window. I can do it when the popup is called from the main page (ADDing records), but I can't figure it out for a popup that is called from within the iframe (EDITing records). In addition to residing within an iframe the button to call the EDIT popup is a Caspio Data Page and is built from javascript during page load. Please consider the following scenario. (I removed classes, titles, and other irrelevant items for simplicity) Main Page: <div id="vehicles"> <div class="frmHeader"> <
  • Create New...