Jump to content

Search the Community

Showing results for tags 'virtual field'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Caspio Bridge
    • Caspio Apps for Ukraine
    • 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 11 results

  1. 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
  2. I have an submission form that allows you to scan barcodes into the system. It goes through several stations and we need it to reject an entry if one or more of the stations do not have records of that serial number making a stop there. Here's how it currently looks: Entry fields: Garment barcode Employee ID barcode Station barcode Virtual fields: When a Garment barcode is scanned, a virtual field displays where it was last scanned (which station) When an Employee ID barcode is scanned, a virtual field displays who the last Employee was that interacted with that item When a Station barcode is scanned, a virtual field displays which station last touched that garment What we would like, is if SN: 123456 reaches Station 2 without first going through Station 1, Station 3 without first Station 2, etc., it's rejected upon attempt to submit the form.
  3. BLUF: does anyone have any suggestions on how to make a submission form's rules engine read the values from a virtual calculated field? i am using virtual calculated fields in a submission form to query five boolean variables in another table which specifies which of the five fields in the form should be required (this is customizable by the user through a separate form). the queries successfully execute and i am getting expected results (i.e. 'Yes' and 'No' for each of the five variables), which are based on the user's selection of a profile in a dropdown in the same form (e.g. profile a, profile b, profile c, which, again, they configure through another form). the queries are dynamic...they correctly recalculate as the user changes their 'profile' selection. i've attached a screenshot of the interface. i need to use these virtual calculated fields ('Yes' and 'No') values in the form's rules so that i can specify which of the fields are mandatory based on the selected profile. though the rules engine seems to be able to distinguish between 'is blank' and 'is not blank' on the virtual fields, it seems incapable of reading the values. that is, i have tried "virutal field 1 is equal to Yes" (or 'yes' or 'true' or 1)....and nothing works. does anyone have any suggestions on how to make the rules engine read the values from a virtual calculated field? p.s. for the form submission, i am using a view which joins the profile table with the test entries table. however, since only the test entries are editable in the view, i don't have access to the profile values (even though they are duly joined through the view) and therefore can't use them directly in the rule. this is why i have had to resort to using virtual calculated fields with sql queries.
  4. Hello, On a Details form, I have a text64000 field (uses Rich Text editor toolbar) to store an address value. This value can come from 3 different places, with different values from each, so, depending on which source the user chooses, I hide/show and use a virtual check box to run javascript on change, to paste a value from another virtual field into the text64000 field. <script> $("[name='cbParamVirtual19']").change(function(){ f_copy_print_address('cbParamVirtual22', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual22")[0].value; }); $("[name='cbParamVirtual20']").change(function(){ f_copy_print_address('cbParamVirtual23', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual23")[0].value; }); $("[name='cbParamVirtual21']").change(function(){ f_copy_print_address('cbParamVirtual24', 'cke_EditRecordItems_ShipAddress'); var v2 = document.getElementsByName("cbParamVirtual24")[0].value; }); </script> This will take the value from Virtual 22, 23, 24 (they are cascading virtual fields, hence the GetElementsByName) respectively and put it into the Items_ShipAddress field. This works fine in terms of getting the address value to show up in the Items_ShipAddress field. The problem is that when Updated this value is not saved (even though you can see it in the Items_ShipAddress field) UNLESS the user clicks into the Items_ShipAddress field and manually types in at least 1 letter (meaning they have to manually edit the field to save the value, the value the js puts in somehow doesn't 'stick'). I tried saving as a variable the values from Virtual 22, 23, 24 when they're generated (as you can see by that line of code above) and then using that variable to 'save' to the Items_ShipAddress field before Submit (code below). But it's not using the variable if/when the user changes the choice of which virtual checkbox to use (the on Change code). This is the code for before submit: <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { document.getElementById("EditRecordItems_ShipAddress").value = v2; }); </script> Any help would be really appreciated (I've tried using calculated values but haven't been able to get it to work for a number of reasons- I'd really just like the js to work).
  5. 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
  6. 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
  7. 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>
  8. 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>
  9. 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?
  10. 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!
  11. 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...