Jump to content

Search the Community

Showing results for tags 'javascript'.

More search options

  • 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






Found 186 results

  1. In my submission form, I wanted the value entered in one of my text fields to be automatically copied in my password and confirm password field. Does anyone have ideas about this? Thanks!
  2. I am looking to implement a simple validation on my form. I would like my user to not submit any numeric value in my submission form.
  3. I have an odd problem trying to work around the lack of "Distinct" query functionality within Caspio. My data has many to many joins and therefore the view lists a specific field multiple times. When I query to reach a list of these fields, there are obviously multiple rows. I am trying to eliminate those multiple rows and list a single row for each unique value in that field only. The problem is that the datapage is still formatted as if all the results are present. So I get multiple pages with only a single entry on each. While I can change the view to include more records per page, that does not actually solve the problem. I would like to be able to prevent the pagination or actually remove the extra rows from the result set instead of just hiding them. Any ideas?
  4. Depending on what location is associated with a user(a column in the user table - the parameter), I would like to selectively hide a specific column in a report datapage. I am able to get Caspio to hide the column as desired on the preview Caspio page , but when deployed, Caspio seems to ALWAYS hide the column, regardless of the Country condition. Could you please take a look? This is where the datapage is deployed: https://dsmtest001.weebly.com/testjsreport.html. There are 2 user accounts-> 1. user1@test.com | 12341234 - Country is USA 2. user2@test.com | 12341234 - Country is Canada Column B should be hidden for the USA user but not the Canadian user. The selective functionality is achieved through the following code, inserted in the header of the report datapage: <script> alert('[@authfield:Country]' +' is the current country ' + ' -> going to hide column/row B if country is USA'); if ('[@authfield:Country]' === 'USA') { document.getElementById('targetxxx').innerHTML = "<style>#targetxxx table:nth-of-type(1) td:nth-of-type(2) {display: none;} </style>"; document.getElementById('targetxxx').innerHTML = "<style>#targetxxx table:nth-of-type(1) th:nth-of-type(2) {display: none;} </style>"; } </script> <div id="targetxxx"> and the below inserted in the footer: </div> Last but not least, attached is the sample Caspio app CaspioData_2019-Feb-25_2157.zip
  5. Here is my dilemma - my initial Client Table is set up to take in up to 2 address and up to 2 names per record to create a Client List. This is because if a husband and wife call us for work, we want them on the same account and such. Same with the Address field, because they may have a personal home and a rental home, in example. My Work Order form, which takes place after finding the client through the Client List, can only take in One address and One name. I couldn't put in two address fields into one dropdown with Caspio Standard Features. To combat that, I created a third page to act between the client list and the Work Order Form. This page will take in a parameter from a button on the Client List, where the user will select the Address and the Name to be on the Work Order Form. So, we made our own dropdown in an HTML table that includes both Addresses, so you can select one. Here is the code for the HTML block dropdown - <select id='test'> <option value="[@field:Primary_Client]">[@field:Primary_Client]</option> <option value="[@field:Additional_Client]">[@field:Additional_Client]</option> </select> I am needing help creating JS script for a query string value - it will send the selected value from the custom HTML Block Dropdown to the Work Order Form. Here are the table designs for the Client List and the Client Work Order list. You can see the Client Table has two address fields and the Client Work Order Table has one. Same with Client Names. The Client List Table is the 1st screenshot, and the Work Order Table is the 2nd.
  6. Hello. I would like to concatenate two text fields (both foreign keys) and populate a third text field in the same table with the concatenated value when submitting a DataPage. I understand how to do this when I am concatenating the stored value of the fields, but I would like to concatenate the display values of the two lookup fields, not their stored values. Please advise.
  7. Hi there, I would appreciate if someone could help me modifying styles of a dropdown on inline insert functionality of Tabular Report Datapage. I have a Cascading dropdown "EMAIL" where I would like to assign a special font and add a bottom border for each option. The challenge I am facing is that I have other dropdowns on this Datapage and I would like them to preserve default styling. Thanks, vitalikssssss
  8. I am using a submission form and trying to customize it. It's a simple script that displays a warning message and stops submission, if a user makes a certain combination of selections(i.e. selects ABC from a dropdown and XYZ is calculated in the Virtual field. However, the code does not seem to work. Could somebody take a look and let me know what I am doing wrong? The UseCaseType is a dropdown with a lookup table linked to it, and the Virtual Parameter is a Calculated Value SQL script(that does work). For some reason, a and b are populated as nulls. <script> document.addEventListener('BeforeFormSubmit', function (event) { var a = document.getElementById("InsertRecordUseCaseType").value; var b = document.getElementById("cbParamVirtual2").value; alert('a is ' + a + ' | b is ' + b); if (a == 'ABC' && b == 'XYZ') { alert('You cannot select ABC and XYZ together'); event.preventDefault(); } }); </script>
  9. In a Single Record Update form I'm trying to update different fields based on the value of a Virtual field. The Virtual field is loading with and External Parameter (number value). Depending on what value that Parameter is I need a specific field to update/change on when the 'Update' button is clicked. I don't want all fields to update, just a single specific field based on the value of the Virtual field. For example: If Virtual1= 3 then update myField1="mytext" If Virtual1=4 then update myField2="mytext" If Virtual1=5 then update myField3="mytext" Here's some code I'm working with but can't seem to get it right. It's in the footer of the Single Record Update form. <script> function changeVal() { var v_product = document.getElementByID("EditRecordcbParamVirtual1").value; if(v_product=="3") { document.getElementById('EditRecordmyField1').value = "Not Activated" } else if (v_product=="4"){ document.getElementById('EditRecordmyField2').value = "Not Activated" } else if (v_product=="5"){ document.getElementById('EditRecordmyField3').value = "Not Activated" } document.getElementById('caspioform').onsubmit = changeVal; </script> I tried this without the 'else if' part (for just the first If=3) but still couldn't get it to work. It's probably just some syntax- any help would be greatly appreciated.
  10. Hello All, I have a Details datapage that I'm using to update a series of related records, one at a time. I've got code to run the update automatically (so the user doesn't have to click a button). The final setting is "Navigate to next/previous records" so it cycles through all the related records (filtered by a common ID number for each record). What I need it to do is, after the LAST records is updated, go to a new web page entirely. I don't know how to do BOTH "Navigate to next/previous records" AND THEN go to a new page after last record is updated. Does anyone know how to do this? Many thanks in advance!
  11. I have a Details page that I'm using Auto Submit code to cycle through and update related records. However, when it gets to the last record (for example, 4 of 4) it keeps in the 'submit' cycle. I need the form to stop submitting once it's submitted the last record. Then, ideally, I need the form to go to another web page. But getting it to stop submitting after the last record update would be a good first step. Does anyone know how to adjust the Auto Submit code I'm using below? <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </script>
  12. I accidentally posted this in the wrong forum (datapages) so I wanted to repost it here: I have some code I'm trying to get to work in the Footer on a Details form to halt AutoSubmit code when a value of 1 is reached in a Virtual field (calculated). The Details datapage is set to go to 'Next Record' on update so the Auto Submit cycles through the records. The problem is that when it gets to the last record it keeps auto submitting and I need it to stop AFTER submitting the last record. I found some code on this forum but can't get it to work- that code was older, before virtual fields could be calculated. If anyone knows how to adjust this code to get it to work that'd be really great. <script type="text/javascript"> if(document.getElementById("caspioform")) { if(document.getElementsByName("cbParamVirtual2")[0].value==1) { document.getElementById("caspioform").style.visibility = 'hidden'; document.write('<font face="arial" color=red size="5">No more Submissions!'); } else { setTimeout('document.forms["caspioform"].submit()',1000); } } </script>
  13. Can any buddy help me i need to add $ symbol on product_price and sub_total.. <script> $( document ).ready(function() { $(document).on("input paste keyup", ".product_qty", function( event ) { var product_quantity = 0; var product_price = 0; var gst_amount = 0; var sub_total = 0; var total_qty = 0; var grand_total = 0 product_quantity = $(this).val(); product_price = $(this).parent().prev().html(); sub_total = product_price * product_quantity; $(this).parent().next().html(sub_total); $('.product_qty' ).each( function( k, v ) { product_quantity = parseInt ( $(this).val() ) ? parseInt ( $(this).val() ) : 0; product_price = parseFloat($(this).parent().prev().html())?parseFloat($(this).parent().prev().html()):0; console.log(product_quantity); console.log(product_price); sub_total = parseFloat ( product_price * product_quantity ); console.log(sub_total); total_qty +=product_quantity; grand_total += sub_total; }); if ( grand_total > 0 ){ gst_amount = ( grand_total * 6 ) /100; } $("#total_qty").html(total_qty); $("#total_amount").html(grand_total); grand_total +=gst_amount; $("#gst_amount").html(gst_amount); $("#discount_amount").html(0); $("#grand_total").html(grand_total); }); // $(document).on("click", ".delete", function( event ) { var cart_item = 0; $(this).parent().parent().remove(); cart_item = $('.product_qty').length; if ( cart_item <= 0 ) { $("#total_qty").html('0'); $("#total_amount").html('0'); $("#gst_amount").html('0'); $("#discount_amount").html(0); $("#grand_total").html('0'); } else { $('.product_qty').trigger('keyup'); } }); }); </script>
  14. Hello, I have a Details datapage set up so when Update is clicked it goes to the next record. I need to figure out how to create a custom button (to put in either the Footer or an HTML block) to go to the Next Record (and a button for Previous, as well) so that the user can cycle through without clicking Update. The standard record navigation arrows at the bottom will not work for UI reasons (I need to make the custom 'Next Record' button relabeled and hidden in various scenarios). Does anyone know how to create a custom button for Next Record? As well, I also need to know how to hide that button (if it's in its own Section in an HTML block) when the Details form is at the 'last record' of the series (because there will be no 'Next Record' at that point). Any help would be greatly appreciated-
  15. Hi! I am trying to create 8 Date/Time fields where the user inputs Date, Hours and Minutes in separate fields. I found some JS that works on combining the input, but it only works on combining one set of the three fields to on Display Field. This is the code that I put in the Footer: <script> //Created_On_From document.getElementsByName('Submit')[0].onmouseover = function(){ var date = document.getElementById('cbParamVirtual11').value; if(date == ""){ date = "00/00/0000"; } var hour = document.getElementById('cbParamVirtual26').value; if(hour == "") { hour = "00"; } var minute = document.getElementById('cbParamVirtual27').value; if(minute == "") { minute = "00"; } document.getElementById('cbParamVirtual49').value = date + " " + hour +":"+ minute; }; </script> <script> //Created_On_To document.getElementsByName('Submit')[0].onmouseover = function(){ var date = document.getElementById('cbParamVirtual18').value; if(date == ""){ date = "00/00/0000"; } var hour = document.getElementById('cbParamVirtual33').value; if(hour == "") { hour = "00"; } var minute = document.getElementById('cbParamVirtual32').value; if(minute == "") { minute = "00"; } document.getElementById('cbParamVirtual48').value = date + " " + hour +":"+ minute; }; </script> Any help would be appreciated...
  16. I want to change the blue color and shape of a selected Dropdown. I believe it takes more than CSS and requires Javascript. Please check the attached image. Any ideas? Thanks! Jared
  17. I have ticketing application, which is spread over many datapages (50+). Out of a userbase of 20, I have 5 users that don't need to see the full app, but only a 'limited' version. I think this could be achieved if I pass a parameter through the login authentication page, which would be received by any subsequent datapages the users visit(and then add conditional logic on each datapage to hide whatever needs to be hidden, if a specific parameter is received). My issue is the standard Caspio interface can only pass the login information (e.g. Email) as a parameter through the authentication page - e.g. [@testpar]? <script> document.addEventListener('BeforeFormSubmit', function (event) { var comparevar = document.getElementById("xip_Email").value; if (comparevar === 'user1email@test.com') { //pass [@testpar] = 'limitedView' } }); </script>
  18. I'm sorry for what is probably a simple question. If I want to use data from a view (ideally - or a table if I had to), making it accessible to a javascript charting library (like d3.js) , how do I export it (or make it real-time accessible) as a json file without jumping through a bunch of hoops? For some reason I'm not making the connection... Thanks so much! Clint
  19. Hi! There is a Tabular report with a comment field (Text64000). I want to add a "Copy Text" button, that on click will copy text from the comment field to the Clipboard, so a customer can copy the text without highlighting and copying. Just one click action to copy. I have found some solution, but it does not look like working in the reports: https://www.w3schools.com/howto/howto_js_copy_clipboard.asp Has anybody done it before or maybe you have some working solution? Thanks in advance.
  20. I am using iframes for a navigation bar from the HowTo article posted Here. The pages inside this tabbed navigation share the same authentication. I have login re directions with their own authentications as well. When I am redirected to the page with the iframes, I still need to log in to the other datapages on the tabs. From there, I can either log in again or refresh the entire page myself (or, really, I can just refresh the iframe I am in and that works too). I know iFrames are tricky and I really don't want to mess with them. I would rather have my employees have to endure another 1 1/2 seconds to have it working right. Could someone help me with a script that reloads the page ONCE when the page is fully loaded? I have been able to get it to refresh, but it keeps refreshing. I am working with onclick query string values so I am not too sure if appending the URL once loaded would work either.
  21. I have an issue with the case on the report page, where the field should be active for adding or visible (hidden before). Details: I have a dropdown for answer revision with three status variants: Pending, Approved and Not Approved. The changes are provided via inline edit. If the message status is not approved I should be able to write a comment, but for the other cases window should not appear or should not be editable. It would be nice if somebody can help me with this case. Thanks.
  22. Hello all, I have an Update datapage where, on Submit, I need to 1) show a popup message saying the changes were saved and 2) close the window or tab of the host page. I set the 'destination' of the datapage to 'Close Window' and put the below js in the footer to show the message. <SCRIPT LANGUAGE="JavaScript"> function myFunction() { alert ('Your updates have been saved') } document.getElementById("caspioform").onsubmit = myFunction; </SCRIPT> The problem is the js seems to block the 'Close Window' function and the page just refreshes to 'same form' and shows the standard 'data has been updated' message. So it seems to me I could put some kind of 'close window' function in the above js and put that in the 'message' section of the Destination wizard. I tried the below but it doesn't actually close the window/tab. <SCRIPT LANGUAGE="JavaScript"> function myFunction() { alert ('Your updates have been saved'); window.close(); } document.getElementById("caspioform").onsubmit = myFunction; </SCRIPT> Basically, I need, on Submit, the tab/window to close and a message to pop up saying data has been saved. Does anyone know how to do this?
  23. I would like to ask for help in my JS code. I'm trying to change the value of a checkbox in a search form when a specific option in a dropdown is selected. I want the checkbox to be set to true if "Math" is selected in the dropdown. Below is my code that's not currently working: <script> function checkdropdown(){ var drpselected = document.getElementsByName("Value1_1").value; if (drpselected == "Math") { document.getElementsByName("Value2_1").checked = true; } else { document.getElementsByName("Value2_1").checked = false; } } document.getElementsByName("Value1_1").onchange = function() {checkdropdown()}; </script> Also, here is a screenshot in the "Configure Search Fields" step of the DataPage: I'm hoping someone can help me with this. Thank you.
  24. I originally had two fields for my Orders App - Quantity_Ordered and Quantity_Received. When our receiving department gets the materials from the orders in, they select an area it is going to be stored. I now have created two new fields - Quantity_Stored and Quantity_Sent. Quantity_Stored is suppose to get its initial number from Quantity Received. So, if we received and stored 4 windows, Quantity_Stored will start at 4. Quantity_Sent is for when we actually send those materials from our shop where it is stored to the job site. Many times we only send parts of the order at a time. I'm trying to figure out how to make Quantity_Stored a formula that is the initial Quantity_Received - Quantity_Sent. However, I am trying to make Quantity_Sent be empty in the table and just execute the formula from the datapage. I.E. - 5 windows received. All 5 stored in bin A2 in our shop. Our Quantity_Stored is for that order is now 5. In the datapage, the user enters 2 into the Quantity_Sent, and the Quantity_Stored is updated to 3. We repeat the process on a future date, but only send 1 window this time. I don't want Quantity_Sent to be populated with 2 already this time, I just want the user to be able to put in 1 more sent instead of doing the math to put in that 3 have been sent all together. Thanks, KPC
  25. Hello, I have been using the following code in the footer of a details data page. It previously worked to concatenate an autocompleted value from a virtual field with a text area field called "associatedSpecies." This is based on the javascript solution from Caspio below, but I'm not sure if this is no longer supported by more recent browsers? Does anyone have any insight on how I might make this work again? <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x0 = document.getElementsByName("EditRecordassociatedSpecies")[0].value; var x1 = document.getElementsByName("cbParamVirtual2")[0].value; if (x0 && x1) { document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0+"; "+x1; } else { document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0 + x1; } } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT>
  • Create New...