Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

  1. I am attempting to use a simply JavaScript to create an extended cost on a submission form. I have a few lines of this. When I add the JavaScript, only the last script works. Almost like it is canceling out the prior. I do not know how to make them both work or how to combine them into one larger script. Any assistance would be greatly appreciated. My lines of code are inserted below. They work individually but not both at once on the same submission form. <SCRIPT LANGUAGE="JavaScript"> function calculateextcost1() { var v_item1 = parseFloat(document.getElementById("InsertRecordITEMUNITS1").value); if (isNaN(v_item1)) v_item1 = 0; var v_cost1 = parseFloat(document.getElementById("InsertRecordITEMCOST1").value); if (isNaN(v_cost1)) v_cost1 = 0; var v_extcost1 = (v_item1 * v_cost1); document.getElementById("InsertRecordITEMEXTCOST1").value = (v_extcost1); } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onchange = calculateextcost1; </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function calculateextcost2() { var v_item2 = parseFloat(document.getElementById("InsertRecordITEMUNITS2").value); if (isNaN(v_item2)) v_item2 = 0; var v_cost2 = parseFloat(document.getElementById("InsertRecordITEMCOST2").value); if (isNaN(v_cost2)) v_cost2 = 0; var v_extcost2 = (v_item2 * v_cost2); document.getElementById("InsertRecordITEMEXTCOST2").value = (v_extcost2); } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onchange = calculateextcost2; </SCRIPT>
  2. Hi there, I am using the standard autosubmit script to send users to one form using parameters to auto fill it and autosubmit it and then on to another form. However some users get stuck in a loop if a field in the first autosubmit form are already in the table, and they never get to the second form and don't see the error message. Is there a way to write into this script "if field already exists in table [users] DO NOT autosubmit, instead show an error message? <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </script> Many thanks Nikki
  3. I have a simple pivot table with 'Years' field across the top and a 'Regions' field and a 'Countries' field down the side. The regions field is collapsible, so the User has the choice whether or not to show the countries inside each region. So far so good. Problem is that In the regions column I want to be able to show selected regions with the collapsible option, but I also want to show (in the same column) other selected regions which do NOT have the collapsible option and therefore just show the aggregate total of their countries. I know this is not a regular option, so I'd be willing to use javascript. Can anyone give guidance on the code to use to access selected fields and records in a pivot table, and also how to apply/remove the 'collapsible' feature at runtime. Many thanks
  4. I am trying to pass the value from specific column totals for use in html page(s) and/or virtual fields. Any help is appreciated. e.g. table with 3 columns and n rows I want to retrieve and pass the total value of column 1, column 2 and column 3 for use on a different webpage or for a custom html field Thanks in advance
  5. Hello all: I have a script I use to create accordions using an image. But, I am want the hovered image and/or the clicked/tapped image to be different as the original accordion image. Any suggestions on the script are appreciated. The script I am using right now is: HTML BLOCK / DISABLED / BEFORE THE SECTION IN THE ACCORDION <center><img src="http://assets.goplaypool.com/files/theme/appcas/updatepass000.png" onClick="Displayer(2)" ></center> <table id="Section2" style="display:none;"><br><td> THEN; HTML BLOCK / DISABLED / AFTER THE SECTION AFTER THE ACCORDION </td></table><br> AND A FOOTER SCRIPT: <script> function Displayer(n) { var check = document.getElementById('Section'+n); if(check.style.display == 'none') { check.style.display='inline'; } else { check.style.display='none'; } } </script> --- Now on hover and/or "open" accordion, I want a different image. Thanks in advance
  6. Hi, I have a tabular report that list my users. One of the fields identify who is active and who is blocked. I want to show an padlock icon on the row of every blocked user. I mean: when the field [@field:Usuarios_Ativo^] value is "no". This is a "yes/no" field type I think that should be easy, but I am really struggling to make this work with my limited java skills. Many thanks Caspio minds!
  7. I'm trying to use an if statement in js that references a data field to see if there's a null value. I can't get the syntax to work though. Here's the code in the footer of a Details datapage: <script> var v_lk = parseFloat(document.getElementById("EditRecordmstrSuppliers_LinkedIn").value); if(!(v_lk) === "") { document.getElementById('section3').style.display = "inline"; document.getElementById('section4').style.display = "none"; } else { document.getElementById('section3').style.display = "none"; document.getElementById('section4').style.display = "inline"; } </script> What's odd is I got this code to work using a test field that was a number format, using <script> var v_lk = parseFloat(document.getElementById("EditRecordmstrSuppliers_TestNumberfield").value); if(!isNaN(v_lk)) So it seems like I'm just not referencing the 'live' field correctly because it's a text field instead of a number field. Does anyone know the correct way to reference a text field to check for null/blank values?
  8. Hi everyone, Does anyone know how to automatically resize an iframe that contains a tabular report? I set the container iframe to a fixed width and height. However, that gives me too much space upon hitting the Search button and viewing the results page, which is larger than the search form. I tried searching online but no luck. Please help. Thanks in advance. -dspolyglot
  9. Hi everyone, Does anyone know how to render a calculated field as HTML? I tried outputting HTML tags inside calculated fields, but they display as plain text. Thanks in advance. -dspolyglot
  10. Hello everyone, Does someone know how to dynamically change the font color of a text column in a tabular report? For instance, I have a field named Indicator and it is the second column in the report. If the text value is equal to "Final", the font color must be set to red. Thanks in advance. -dspolyglot
  11. I have a search form and a results form on the same page. I reload the values in the search form (by receiving a parameter) so that the user can see what filters are being used to get the current results. This works great except... When I try and use the reset() form method it will not remove values that were previously submitted. I have also tried explicitly setting the value in those fields to nothing using something like this: function clearForm () { document.getElementsByName('cbParamVirtual7')[0].value=""; document.getElementById('cbParamVirtual17').value=""; document.getElementById('cbParamVirtual18').value=""; document.getElementById('cbParamVirtual19').value=""; document.getElementById('caspioform').reset(); } This does clear the checkboxes but will not clear the text fields if they have already been submitted in a query. I have attached an screenshot of the search filters. Any suggestions of how to solve this or work around the issue would be greatly appreciated. Thanks, Joel
  12. I have an employee document submission form. This table has a field called [@field:hours]. Would like to have a virtual field which tells how many cumulative hours for a specific [@employeeID]. Would like the field to auto populate once the submission form is accessed. In other words, as soon as I select the employee from the results page, would like the details page to calculate how many hours this employee has. Thanks for your help. After Re-Reading my explanation. I could have simplified by saying, utilizing JavaScript, how do you sum a column and store the result in a field ?
  13. Is it possible, using javascript / jQuery, to extract data from specific fields in a Caspio table, or its results datapage, and assign that data to an array? If so, can this code be made to work by placing it in an HTML block inside the relevant datapage? Please give me an example of the code that would achieve this. Thanks
  14. Anyone know how to have the listbox height be automatic based on how many records there are in it? At times my users have 2 records & others 5+ records so having a box that auto sizes per the number of records would be optimal.
  15. Hello, I saw this How-to article on changing the background of a row based on the value of a field: http://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/ However, I need to delete the row instead of changing its background color. Also, I need to delete the row when a calculation returns a blank value. Is this possible? I don't know how to write JavaScript code.
  16. Hi there, I've built a page that has a grid of images, allowing users to click on these images to make a selection ... and then I want these selections to all be saved to a table as separate entries along with their user information. So far, I can get only 1 selection to pass to the table. If they click on one of the images, that is sent to the table, fine. I've set it up so that each selection is added to the string, separated by a comma, but then this passes to the table as a single entry with the comma separated string. This is my code: function SelDatasource1() { document.getElementById("Datasource1").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource1,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelDatasource2() { document.getElementById("Datasource2").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource2,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } ...etc etc ... there are over 30 of these. If somebody selects Datasource1, Datasource5, Datasource12, it shows up in the table like this: PROJECT DATASOURCE Project1,Project1,Project1 Datasource1,Datasource5,Datasource12 I am using a Submission form datapage at present, and have added my code using html blocks and footer. 2 things I need help on: 1. I know there is a better way to add a comma to the string, other than putting it in like this (i.e. value +="Datasource1,"). This way, a comma is added for a single entry and at the end of a long string, which I don't want to do - can anybody help me with this? 2. Can I pass this comma separated string so that it shows up in my table like this: PROJECT DATASOURCE Project1 Datasource1 Project1 Datasource5 Project1 Datasource12 Any help would be greatly appreciated! Many thanks Nikki
  17. The login data page is being blocked from being used as soon as the page renders. I checked the console and the embed code seems to be causing a problem. This is the message in the console. A Parser-blocking, cross-origin script, https://c4fot477.caspio.com/dp.asp?cbqe=QXBwS2V5PWM1NDQ1MDAwZGU1ZjUxY2RiMDJ…nI9YzU0NDUwMDBkZTVmNTFjZGIwMmU0MzNlODJiOQ==&cbEmbedTimeStamp=1487653960962, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. f_cbload @ embed.js:1 (anonymous) @ ?cbr=c544500…:56 The chrome status link talks about 2g connections. I'm on a desktop. Does anyone have a clue on what could cause this issue?
  18. Hi there, I would like to share a JS solution which I have used for my project. This script that can be used to clear fields in the bulk edit screen. The bulk edit screen typically displays the data from the last update, and my JS allows not show the previous content of fields. Place following JS into the Footer of Bulk edit screen. Make sure that you have disabled HTML editor. <script type="text/javascript"> var aaa= document.getElementById("BulkUpdateFormBody"); var v_li = aaa.getElementsByTagName("input"); var v_ls = aaa.getElementsByTagName("select"); var v_lt = aaa.getElementsByTagName("textarea"); var f_tmpf = function(v_list, v_resList){ var v_res = v_resList || []; var v_length = v_list.length; for(var v_i = 0; v_i < v_length; v_i++) if((v_list[v_i].type || "").toUpperCase()!="HIDDEN" && (v_list[v_i].nodeName||'').search(/input|select|textarea/ig) != -1) v_res.push(v_list[v_i]); v_resList = v_res; return v_res; } var v_cleanI=f_tmpf(v_lt, f_tmpf(v_ls, f_tmpf(v_li, []))); v_cleanI.forEach(function(v_i){ v_i.value = ""; }); </script> I hope this will be useful for someone.
  19. Hi I need to add a button that will redirect to a specific page on a HTML form This button must be visible or not visible based on a condition from an authentication field I created the html form and added this code: <script> if("[@authfield:User_Role]" == "Manager") { ---> Add a code here that will show a button that will redirect to a page } </script> Can someone send me an example code that I can place between the brackets? I tried several options but nothing works.
  20. I have a combined chart and report datapage that I use to display a list of jobs and their status. I would like the list and chart to have dynamic colours according to their status. This is quite easily accomplished, and in fact I have already completed it. My issue comes in place with AJAX. I cannot disable AJAX on a combined chart/report datapage, therefore when I do a bulk edit on my report, the chart reverts back to the default colours. I am guessing this is because the chart loads without running the javascript in the datapage. Is there a way to execute javascript in a datapage not only on load, but also on an AJAX call? Thanks, Josh EDIT: I just realized that it's not because of the combined chart/report that I cannot turn off AJAX, but it is because of the grid edit.
  21. Hi Everyone, I'm very much a newbie on the Caspio platform, but I've been making great strides. I have a datapage created that has two columns that can have a value of an "N". I would like to create some form of code to allow the value to blink, if it is equal "N". Is that possible and can anyone assist me in accomplishing this? Thank you! -Anthony
  22. When I had my onboarding with Caspio helped with some Java Script to replace a blank space with " OR " so we could search on a field using "Contains" versus "Equals". We are now trying to duplicate this code in a new data page and it is not working. The data page where it does work is "Search Bar" on field "Virtual4" and the code is in the header and the footer. The results are then passed to another data page. I now want to create a data page where the search is contained in the page and the results are not passed. The functionality we need is to cut & paste style #'s into the search box and upon clicking submit the script runs and replaces the space with " OR " and the "contains" search runs. Here is an example use case Cut and paste "CM7661 CM7662 CM7854" Click Submit Script runs and replaces the spaces with " OR " and the query looks like "CM7661 OR CM7662 OR CM7854" The results for the 3 style numbers are returned The code we have in the header is: <div id="search"> The code we have in the footer is: <script> document.getElementById('search').onsubmit= function (){ var txt = document.getElementById('cbParamSeason_Table_Style').value; document.getElementById('cbParamSeason_Table_Style').value = txt.replace(/\s+/g, " OR "); } </script> Why is this not working? Thanks, Jeff
  23. Hi, I want to output a parent record and its linked child records (a variable number of records) as a JSON array to display in a html page that consists of sections. Each section contains one or more fields from either the child or parent record(s). I would like to be able to push the data upon clicking a button. Following is an example of what I mean. (NB: The actual Parent Table has 10 fields and the Child table has 60 fields, including some that are formula fields). Parent table fields: FIELD: PID PF1 PF2 PF3 TYPE (autonumber) text date number Child Table fields: FIELD: CID (autonumber) PID CF2 CF3 CF4 CF5 TYPE (autonumber) integer text date number checkbox PID is an Integer field and relationship linked to same field in Parent table. Section 1 [CF3-record1] [CF3-record2] [CF3-record3] Section 2 [CF2-record1] [CF4-record1] [CF2-record2] [CF4-record2] [CF2-record3] [CF4-record3] Section 3 [CF5-record1] [PF1] [CF5-record2] [PF1] [CF5-record3] [PF1] It would be much appreciated if someone can assist by providing some instructions and javascript if needed. Many thanks!
  24. I am trying to allow for this JQuery tag affect to occur when the user types in to the text area in the virtual field of my submission form but have not been successful. Disclosure: Since I am new to Javascript, I was wondering if I am referencing the JQuery and Tag-It components properly? I attempted switching the id/class element with "cbParamVirtual1" and "caspioform" but no luck. I would appreciate anyone's feedback. (This is in the footer of the datapage.) <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript" charset="utf-8"></script><script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tag-it/2.0/js/tag-it.js" type="text/javascript" charset="utf-8"></script> <script language="JavaScript"> $(function(){ //------------------------------- // Single field //------------------------------- $('cbParamVirtual1').tagit({ // This will make Tag-it submit a single form value, as a comma-delimited field. singleField: true, singleFieldDelimiter: ',', singleFieldNode: $('#mySingleField') }); }); </script>
  25. Hi, I've reviewed the forums and have been able to successfully pass virtual field data into my Caspio tables using the '"Cascading drop-downs" JavaScript code method in the header and footer section of the form. It's working perfectly. I'm currently having an issue passing virtual field data into my Caspio table using a "Single Record" update form; which is required for my multi-step submission form . I modified the code for 'text field' (removing the [0]) since cascading drop-downs are not being used. The user will be entering data into the form directly. The code I'm using to 'get' the virtual text field value in the Header section of the single record update form is: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x = document.getElementsByName("cbParamVirtual1").value; document.getElementById("LandFillRate1_Field").value = x; var x = document.getElementsByName("cbParamVirtual2").value; document.getElementById("LandFillRate2_Field").value = x; var x = document.getElementsByName("cbParamVirtual3").value; document.getElementById("LandFillRate3_Field").value = x; var x = document.getElementsByName("cbParamVirtual4").value; document.getElementById("LandFillRate4_Field").value = x; var x = document.getElementsByName("cbParamVirtual5").value; document.getElementById("LandFillRate5_Field").value = x; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> The code I'm using to insertrecord into the table in the Footer Section of the single record update form is as follows: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x = document.getElementById("cbParamVirtual1").value; document.getElementById("InsertRecordLandFillRate1").value = x; var x = document.getElementById("cbParamVirtual2").value; document.getElementById("InsertRecordLandFillRate2").value = x; var x = document.getElementById("cbParamVirtual3").value; document.getElementById("InsertRecordLandFillRate3").value = x; var x = document.getElementById("cbParamVirtual4").value; document.getElementById("InsertRecordLandFillRate4").value = x; var x = document.getElementById("cbParamVirtual5").value; document.getElementById("InsertRecordLandFillRate5").value = x; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Unsure if my getElement should be by Name or ID; and if it differs between the header and footer scripts. The examples for the footer script show ID and the header shows name. I'm officially confused. I'd greatly appreciate any assistance provided. I checked the script using the F12 function in the console and everything looks good but still no data showing in the table. Thanks, Bre
×
×
  • Create New...