Jump to content

Search the Community

Showing results for tags 'js'.



More search options

  • 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


Found 15 results

  1. I have found that if I manually click on a dropdown that is a parent to another cascading dropdown, the cascading dropdown works. But when I try to use javascript to change the value of that parent dropdown, I find that it does not kick off the cascading activity of the cascading dropdown that is connect to it. Strangely, the value changes in the parent dropdown (so it works), but it doesn't impact the cascading dropdown. The js code I am using to change the parent dropdown value is: document.getElementsByName("cbParamVirtual1")[0].value="2012"; which successfully updates the value, so I know the JS works. But it doesn't impact the cascading dropdown. Is there an onchange event that is misfiring? Any suggestions?
  2. I want to achieve this simple calculation (below) in my details page. This is where the user enters new lab_fee and the update should take place for the value of TotalFee. It should automaticcally display the value before i hit the Update button on the details page. .... var v1 = document.getElementById("EditRecordlab_fee").value; var v2 = document.getElementById("EditRecordc_discount").value; var v3 = document.getElementById("EditRecordcredit_charge").value; var v4 = v2 + v3 - v1; document.getElementById("EditRecordTotalFee").value = Round(v4,2); .... According to Caspio Bridge 13.0, it was suggested that the below javascript could do the job. i guess for my case i have to put some codes in the //do somethig. Or I might be wrong. Can anyone kindly help me on this? <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { // do something }); </script>
  3. PaulHall

    Multi-column Lookup list in a DataPage

    I need to set up a multi-column lookup list in the middle of a datapage. I have looked extensively and have not yet found an example. It would seem that others may have had this need. It looks like the existing listbox is not set up, yet, to handle multiple fields/columns. I am open to a HTML block solution, but, I don't know enough HTML myself to know how to build a multi-row, multi-column table dynamically that ties to a table. (the count of qualified records varies depending on the client business being profiled). The solution may be a data array built in javascript with nested for loops, that would feed the HTML table. I also have another multi-column lookup list where the cells/values of one of the columns needs to be editable. Currently records in the listbox control are not editable. I can build a static HTML table that includes edit boxes. The challenge here might be how to make this dynamic off a lookup dataset and insure that changed values in those edit boxes write back to the table they came from. I've even looked at an alternative solution of setting up a separate results table on a different datapage and then embed that in the middle of the datapage. But, currently Caspio does not seem to have the ability to embed a small tabular object from one datapage, into another. (The only way to do this seems to be to mash up two datapages on a webpage... but this does not give the user the in-line experience. Looking for expert guidance. Thanks in advance for any suggestions. Again, it seems like several other Caspio developers would have a use for such a solution. (maybe one is obvious and I am just not seeing it.) Thanks!
  4. Years ago I added some JavaScript to my forms to prevent clients from selecting a "due date" that isn't at least two weeks in the future. Recently that code has stopped working, and all submissions are allowed through, regardless of the date selected. I think this may be tied to the recent Caspio updates. At least, that's all that I can see; the forms themselves haven't changed. Below I'm pasting my JS, which resides in the footer area of my forms. Any ideas would be greatly appreciated. Thanks! (BTW, I know two weeks is 14 days, not 13. But my users don't seem to recognize that, so I made this small allowance.) <SCRIPT LANGUAGE="JavaScript"> function check_date() { var entered_value = document.getElementById("InsertRecorddateNeeded").value; var entered_date = new Date(entered_value); var two_week_date = new Date(); two_week_date.setDate(two_week_date.getDate() + 13); if(entered_date < two_week_date) { alert("Must be at least 2 weeks in future"); return false; } } document.getElementById("caspioform").onsubmit=check_date; </SCRIPT>
  5. I am look for a JavaScript that I can use to activate a field in a result table, then make it editable so that the user can increase or decrease the value in the field by just clicking on a plus or minus button, which have counter-increment function, next to the field on the same row and finally update the field automatically. I would like to implement a script that can do this task instead of a user clicking on the edit button then adding value in the field and then click the update button. Has anybody done this. Please help. LM
  6. I have a field called LockStatus that I do not display on the form (it gets checked somewhere else). If it is checked then I want to hide the update button. This is the code I'm using, however the update button refuses to hide. <script> if (document.getElementById("EditRecordLockStatus").checked){ document.getElementById("Mod0EditRecord").style.display="none"; } </script> Am I doing something wrong?
  7. Hello, I have some code running in the footer of an Update datapage that on change of one virtual field (Virtual 4: drop down) gets the value of another virtual field (Virtual 7: cascading text, with Virtual 4 as the ParentID) and copies that value of Virtual 7 into a text64000 field. The problem is it keeps getting the 'previous' value of Virtual 7 and not the current one, when Virtual 4 is updated. Meaning the code runs the 'copy' function BEFORE Virtual 7 is updated. I need to get the 'updated' data from Virtual 7 and copy that into the text64000 field. The code I'm using is: $("[name='cbParamVirtual4']").change(function(){ f_copy_print_address('cbParamVirtual7', 'cke_EditRecordShipToAddress'); }); So if there's some way to 'refresh' or 'update' Virtual 7 before the f_copy_print_address code runs that'd be great. Many thanks!
  8. Hi I am new to caspio, JS. I have a attendee checkin screen. I need to validate attendee by entering least on to the validation values to make sure the right person is checkedin. I have 3 validation values, code sent at the time of registration, mobile number and email. I have setup an update for with 3 virtual fields and modified a JS function I found on this forum to check if atleast on of the field is entered and then to check the enter field is same as on record. For some reason the fucntion never get call when I click the update button. below is the code. Really appreciate if someone can point what I am missing/doing wrong. Thanks in advance for your help. <script language="Javascript"> function myFunction() { var field_code = document.getElementById("cbParamVirtual1").value; var field_email = document.getElementById("cbParamVirtual2").value; var field_phone = document.getElementById("cbParamVirtual3").value; if (field_code == "" && field_phone == "" && field_email == ""){ alert("Please enter at least one verification value. Please try again."); return false; } else if ( field_code !== "") { If (field_code !== [@field:ER_CODE]{ alert("Attendee Code did not match. Please try again."); return false; } } else if (field_phone !== "") { If (field_phone !== [@field:Phone#]{ alert("Attendee Phone number did not match. Please try again."); return false; } } else if (field_email !== "") { if (field_email !== [@field:Email]) { alert("Attendee Email did not match. Please try again."); return false; } } } document.getElementById("caspioform"). Mod0EditRecord = myFunction; </script>
  9. We have a requirement for our Users to be able to update v quickly a large number of records within a tabular type report. The Bulk Edit/Update on its own wont work for us as we need to - when updating each of the records - to concatenate two Notes fields together along with a system date within each record and update another field. We can do this quite easily with JS in aa single Details Page (simple JS concatenating the two different notes values and adding today's date). However this approach does not seem to work on the Bulk Edit/Update - as whilst we can change a common field value across multiple records we cant get JS to individually do a concatenation in each of the records involved. Am really interested in any ideas for this. Our latest thinking - please comment - is to use a Tabular report of searched records to display in std tabular form to the User. But to have an HTML block at the end that has a URL link they can click. This would open some kind of hidden web window/tab containing a Details record that we can apply the JS to (as advised above) for concatenating the two Notes field values and the date within each record. We have not quite got this to work and I would be really interested in views from this Forum. A key stumbling block is to arrange for a Parameter value that can be selected once - whilst at the Tabular report - and then reused/retained as the User works his/her way down the list by clinking on the link quickly opening/closing a Details form (using Auto Submit?). This parameter value we use to update a field with the records status. It and the values of the Notes fields that we concatenate and then update another field and really the record changes we are trying to accomplish. We have tried using a second datapage with a dropdown of the values that would hold a parameter value to pass over. However it loses its value after the first click. We were wondering if we could have somekind of dropbox field that we could set once and which would then keep its parameter value held whilst the User was clicking the html link block on the Tabular report and then activating the hidden web window/tab with the Details record. Any ideas from you experts out there :-)
  10. Hello, I've got a submission form with 2 fields that I need to concatenate into one field (ideally with a space between the values as it's a 'first name' and 'last name' value that need to be put into a 'full name' field. Again, I'm trying to do this on Change for First or Last name so Full_Name autofills as the user enters values. The code I'm using below doesn't work so I must be missing something. If someone can look at the syntax that'd be awesome. <SCRIPT LANGUAGE="JavaScript"> $("#InsertRecordFirst_Name, #InsertRecordLast_Name").change(function(){ var v_first = document.getElementById("InsertRecordFirst_Name").value; var v_last = document.getElementById("InsertRecordLast_Name").value; var v_fullname = v_first + v_last; document.getElementById("InsertRecordFull_Name").value = v_fullname; }); </SCRIPT>
  11. I have a HTML datapage which is the user' s main menu to my app. Now I would like to test whether the user is restricted in it's use of the first of four menu items. I have the following code, but it returns "file or directory not found" when I preview it and choose the 1st menu item: <script> window.onload = testFormRes; function testFormRes() { var dynLink; if ("[@authfield:Restricted^]"=="yes"){ dynLink="https://c0ect240.caspio.com/dp.asp?AppKey=eeda30004146e1be17fe4f64a319"; } else{ dynLink="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000a155f226d27146b0ae20"; } } </script> <div id="menu-mobile"> <div id="row"> <h1><i>[@authfield:Cust_Name]</i></h1> <h2>Main Menu - Res</h2> </div> <div id="row"> <div id="mobileNavagtion"> <ul> <li><a href=("dynLink") class="btnPatrolForm">ActivityForm</a></li> <li><a href="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000a31708e7da464d9e9b63" class="btnPostOrders">Post Orders</a></li> <li><a href="https://c0ect240.caspio.com/dp.asp?AppKey=eeda3000d7e592f401a541d4b948" class="btnReportsMain">Reports</a></li> <li><a href="https://c0ect240.caspio.com/folderlogout" class="btnLogout" class="btnLogout">Logout</a></li> </ul> </div> </div> </div> As one can probably detect, I am a novice at coding, any help would be appreciated! Richard
  12. 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 statement inside the parenthesis with "InsertRecordVirtual10", that last one based on what I found here: Radio Button: A radio button includes multiple options and each option has an associated ID. The ID is a name followed by a number: - InsertRecordFIELDNAMEX - X is the radio button option order, which starts at 0 and increments based on the order of each radio option. For example if your radio button has three options: Red, Blue, Green - Red is InsertRecordFIELDNAME0 - Blue is InsertRecordFIELDNAME1 - Green is InsertRecordFIELDNAME2 Is it possible to do what I am trying to do with a Virtual Field? If it is, how can I make it work? I appreciate your help!
  13. 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.caspio.com/dp.asp?AppKey=ExampleB?PersonID=[@authfield:PersonID#]&Email=[@authfield:Email]">Link To Review</a> "; } </script>
  14. Hello; I use the JavaScript Here to format phone numbers. <SCRIPT LANGUAGE="JavaScript"> function f_a(v_id) { return document.getElementById(v_id); } f_a('InsertRecordPhone').maxLength = 14; f_a('InsertRecordPhone').onkeyup = function(v_e) { v_e = v_e || window.event; if (v_e.keyCode >= 65 && v_e.keyCode <= 90){ this.value = this.value.substr(0, this.value.length - 1); return false; }else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){ return true; } var v_value =(this.value.replace(/[^\d]/g, '')); if (v_value.length==7) { this.value = (v_value.substring(0,3) + "-" + v_value.substring(3,7));} else if(v_value.length==10){ this.value = ("(" + v_value.substring(0,3) + ") " + v_value.substring(3,6) + "-" + v_value.substring(6,10)); }; } </SCRIPT> Does anybody know how to get a search field to behave the same way? I've tried InsertRecordPhone, SearchPhone, EditRecordPhone, Search, and Value1_1(It's actual id). Thanks
  15. I have a form that currently uses Dropdowns and want to change them to Radio buttons. Not a biggie, but I'm not sure what I need to change on my script to make it work. It seems that the radio button has 2 fields, so I think I have to somehow choose which is selected? I'm a bit of a novice, so any help would be greatly appreciated. Here is my current script: <SCRIPT LANGUAGE="JavaScript"> function calculate() { var v_q1 = parseFloat(document.getElementById("InsertRecordSec1Q1").value); var v_q2 = parseFloat(document.getElementById("InsertRecordSec1Q2").value); var v_q3 = parseFloat(document.getElementById("InsertRecordSec1Q3").value); var v_q4 = parseFloat(document.getElementById("InsertRecordSec1Q4").value); var v_q5 = parseFloat(document.getElementById("InsertRecordSec1Q5").value); var v_q6 = parseFloat(document.getElementById("InsertRecordSec1Q6").value); var v_Sec1total = (v_q1+v_q2+v_q3+v_q4+v_q5+v_q6); document.getElementById("InsertRecordSec1TotalScore").value = Math.round(v_Sec1total);
×