Jump to content

Search the Community

Showing results for tags 'virtual field'.



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


MSN


Website URL


ICQ


Yahoo


Skype


Location


Interests

Found 8 results

  1. Hi I am stuck with javascript doing multiple calculations in same datapage. 1st javascript is calculation of unit cost, no of units and total (in local currency) 2nd javascript is convert local unit cost to USD based on cascading dropdown field 3rd javascript is using unit cost (in USD), no of units to derive total cost (in USD) the 1st javascript seems to be working. But when I add on 2nd javascript, only one value shows and in the wrong field. There is also no error appearing in the web console. Eg javascript 1 calculation = virtual field 1 = virtual field 1 value javascript 2 calculation = virtual field 2 = virtual field 2 value Instead what i see is this javascript 1 = virtual field 1 = virtual field 2 value javascript 2 = virtual field 2 = blank I followed basically this script and did my own modification http://forums.caspio.com/index.php?/topic/6053-perform-calculations-in-submission-form/ I think the problem is I did not define 2 variable that points to virtual field 1 and virtual field 2 respectively. var totalField = document.getElementsByClassName('cbFormData')[0]; I need 2 of it, and I do not how to define for the 2nd virtual field. Also, how do I pass the the virtual field to a table field? I used the Pass field value as parameter, it does not seem to write into the table. Can anyone please help? <script type="text/javascript"> // Caspio form elements to calculate local total cost var unitcostField = document.getElementById('InsertRecordLocalUnitCost'); var unitsField = document.getElementById('InsertRecordUnit'); // var totalField = document.getElementById("cbParamVirtual1"); ** I tried using this to point to virtual field but it did not work ** var totalField = document.getElementsByClassName('cbFormData')[0]; // Caspio form elements to convert local to USD cost var exchangerateField = document.getElementsByName("InsertRecordExchangeRate")[0]; //var convertField = document.getElementById("cbParamVirtual2"); ** I tried using this to point to virtual field but it did not work ** var convertField = document.getElementsByClassName('cbFormData')[0]; var caspioForm = document.getElementById('caspioform'); // Event handler var calculateTotal = function (event) { // TODO: Do something on value change --> totalField.innerHTML = unitcostField.value * unitsField.value; } var calculateExchangeRate = function (event) { // TODO: Do something on value change --> convertField.innerHTML = (1/exchangerateField.value) * unitcostField.value; } // Run total calculation on input to any of these two fields unitcostField.addEventListener('input', calculateTotal); unitsField.addEventListener('input', calculateTotal); unitsField.addEventListener('input', calculateExchangeRate); unitcostField.addEventListener('input', calculateExchangeRate); </script> Thanks in Advance
  2. As is obvious, by my member name, i am not a programmer ( naturally that is why I selected Caspoi!) - So from that please read warning dummy ahead and 'extra explicit please' I have a data page that mostly works real well. Just one area has crossed me over:- I have in a simple Table(1) and it has just two fields an ID and a Message (text 6400). I have a second Table(2) and it also has amongst many other fields, a field also called Message (text 6400). My data page has data source of Table(2), it is a form. On entry to the data page a parameter comes with @Mid (message id for Table(1)). I use a virtual field [ Virtual3], with Form Element 'Cascading Text Field' and @Mid to select the appropriate 'standard message' from Table(1). Sometime it is necessary to adjust/change/ personalise the message, the virtual field accommodates that very well. So far, so good no issues. Final, when I press submit ,I want the data (changed or otherwise in Virtual3) to be saved in new Table(2) record in Table(2) Message, but can't figure out how to do that (if have seen some scripts that maybe can do this but I am not a programmer so I am not sure?). Happy to answer questions Thanks in advance for your help
  3. Hi everyone, I'm fairly new to the world of JavaScript and have the following scenario on a submission page: During submission, my users select a business client using an AutoComplete field. Once they selected a client, two virtual fields pull two values for this client from an external table. These lookups are set up using cascading text field. On the same DataPage, there is a radio button with two options. Should the two virtual fields remain blank (basically meaning that there is no value for either of the fields for this client in the external table), the 2nd radio button option should be selected and the field hidden to prevent user interaction. The hiding and selection part works fine, but it seems that I'm not able to get the value from the virtual fields and my script stops working as soon as I add the condition that involves the value of any of the two virtual fields: <script type= "text/javascript"> function AMFCheck() { var AMF1 = document.getElementById('cbParamVirtual12')[0].value; var AMF2 = document.getElementById('cbParamVirtual13')[0].value; if (AMF1 == "" && AMF2 == "" ) { document.getElementById("InsertRecordAMF_payable1").checked = true; document.getElementById("InsertRecordAMF_payable").style.display = "none"; } } document.getElementById("caspioform").onchange=AMFCheck; </script> I'd be really grateful for any help. Thanks, Christof
  4. Hi Hope someone can help me out here with my javascript problem. I have a submission form (which is multi-step form, 2nd page of a form which is now a update form) which is collecting information like project type, project name, description. It is cascading from project type -> project name -> description Because I can't do a cascading text area for "description". I have created a virtual text field for this value hoping to copy this into the "description" text area. I am having no luck with javscript which I have modify from what i found on this forum. Can someone please help me? This is what I have came up with. <script type="text/javascript"> // Caspio form elements var description = document.getElementById('EditRecordDescription'); var temp_description = getElementsByName("cbParamVirtual1")[0].value; var caspioForm = document.getElementById('caspioform'); // Event handler var Copy = function () { // TODO: assign value to description field description.innerHTML = temp_description; } document.getElementById("caspioform").onload= Copy; </script>
  5. I'm trying to use an html link (in a Virtual Field set to Display Html) with id k_suppliermark to start a function to copy a virtual field's (cascading text) value to a stored field in a Submission form. I've tried a few ways based on things I've found in the forums but cannot get it to work. It should be simple, I would think... The stored field is 'Markup' with is set to be a Cascading Text field (editable) and the virtual field is Virtual8. The 'Markup' value can come from 3 places: the cascading parent table's value, or the Virtual8, or the user can type it in. I need each of these to work. Currently the Virtual8 is the only one that doesn't work. Can anyone see what I've gotten wrong here? The below code is in an html block at the bottom of the submission form. <script> $("#k_suppliermark").click(function CopyVirtual() { document.getElementById('InsertRecordMarkup').value=document.getElementById("cbParamVirtual8").value }) </script>
  6. Hi, I've been separating the Search and Reports data pages and using the Virtual field set-up to pass parameters. I've done this a few times before and it works ok. This time, I require the filter on the search to use 'Date from' and 'Date to' parameters. However, I can't find a way of formatting the virtual field such that it passes the dates in UK format, as opposed to US. Without this, my search is showing up the wrong results, if any. Any thoughts?
  7. We are have created a two web page setup that allows us to do a keyword search across the database. The field in question is 'keywords', and is a virtual field. The challenge is, we would like to capture the search terms being entered in the 'keywords' field and save them to another table. Is this even possible? We are getting stymied by the virtual field aspect - how to maintain it as a virtual field, but also capture the data entered there. Suggestions? Thank you!
  8. In a detail page I have a field that is a check box, I also have a virtual field that displays text. When the checkbox is NOT checked I want the virtual field hidden. For some reason the rules do not allow me to "hide" any virtual fields. Any suggestions why?
×
×
  • Create New...