Jump to content

lmooring

Caspio Ninja
  • Content Count

    38
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by lmooring

  1. Hi thank you for the response. Unfortunately formula fields are not visible on the submission form (to my knowledge). I need the date+1 to appear on the submission form prior to submission. If the date needs to be changed due to the result of the +1 date calculation, the user can do so prior to submitting the form.
  2. Hi, I have a simply one that I just can not figure out. I know it's easy but I haven't been able to get this to work. I have a field where the user will enter a date. I want to take that date and add one, then insert into another field on a submission form. Field Name: End Date (user entered) = 10/23/2017 Field Name: Expire Date (calculated) = 10/24/2017 Any help would be appreciated.
  3. Quick question because I have similar issue. What if you wanted the date to appear on the submission prior to the form being submitted? So if the user needed to change the date based on the calculation result they could? A formula field would give you the correct result but is not able to be displayed on the submission form.
  4. 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>
  5. This worked perfectly, thank you so much!
  6. Hi, Sorry for the confusion. I retyped it several times before posting trying to make it clear. I've reread the specs and discussed with the business owner. This is how I now understand it and yes, it is validation. IF PACKTYPE = "SIMPLE" THEN SIMPLEUNIT should be EQUAL to "1" IF PACKTYPE = "COMPLEX" THEN COMPLEXUNIT should be >= to "2"
  7. I need to create an alert on a submission form where, If the drop down box PACKTYPE is = "Simple" then if text field SIMPLEUNIT not equal to 1 Else if PACKTYPE is = "Complex" then a second text field COMPLEXUNITS must be =<2 or greater than 1, which ever is easier. I would like to include alert messages if possible. I am not sure how to write this. I am sure it is simple but I am not familiar enough and not in submission forms. I've only seen items for reports. Any help is appreciated!
  8. Hi Blarney, I have not. I am still waiting for either a miracle or a Eureka moment ...!
  9. Hi Twired, I don't know that I am javascript savvy enough to get this into my form. I updated the scripts above to distinct function names, so I have checkCOST and checkMOQ. Based on my understanding of the articles you gave I added :<form onsubmit="return ((checkCOST() & checkMOQ()) == 1)"> to my footer but I am not able to get anything to work. I did determine that the third script "f_vendorstyle" was acting correctly and was not required in the onsubmit validation. Any additional assistance or guidance would be most appreciated.
  10. Hi! I have multiple scripts for a submission page. When I execute the page I am only able to get one to work at a time. Not all three. I am not sure what I am doing wrong. Any help or advice would be appreciated. I have pasted the scripts below. I have all the scripts in the footer of the page. The first simply checks that the MOQ field is greater than the Inner Pack field. The second checks that cost is less than retail. They third, if the virtual check box is checked, it will copy the data from the Vendor VPN field to the Vendor Style field. <SCRIPT LANGUAGE="JavaScript"> function check() { var v_moq = parseFloat(document.getElementById("InsertRecordMOQ").value); var v_innerpack = parseFloat(document.getElementById("InsertRecordINNERPACK").value); if(v_moq<v_innerpack) { window.alert("MOQ Must Be Less Than The Inner Pack"); return false; } } document.getElementById("caspioform").onsubmit=check; </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> function check() { var v_cost = parseFloat(document.getElementById("InsertRecordCOST").value); var v_retail = parseFloat(document.getElementById("InsertRecordRETAIL").value); if(v_cost>v_retail) { window.alert("Vendor Cost must be less than Retail"); return false; } } document.getElementById("caspioform").onsubmit=check; </SCRIPT> <script> function f_vendorstyle() { if(document.getElementById('cbParamVirtual1').checked) { document.getElementById('InsertRecordVENDORSTYLE').value=document.getElementById('InsertRecordVENDORVPN').value; } else { document.getElementById('InsertRecordVENDORSTYLE').value=""; } } document.getElementById('cbParamVirtual1').onclick= f_vendorstyle; </script>
  11. Hi Caspio World, I feel like this is an easy one, but I am not able to figure out the java scripting. I have two fields on a submission form; Cost and Retail. I am looking for a simple data check script to make sure that cost is always less than the retail amount. If Cost is greater, an alert pops up, "cost must be less." Thank you for any assistance.
  12. I found this scripting that might be helpful. I am uncertain how to translate this for Caspio. function checkEan(eanCode) { // Check if only digits var ValidChars = "0123456789"; for (i = 0; i < eanCode.length; i++) { digit = eanCode.charAt(i); if (ValidChars.indexOf(digit) == -1) { return false; } } // Add five 0 if the code has only 8 digits if (eanCode.length == 8 ) { eanCode = "00000" + eanCode; } // Check for 13 digits otherwise else if (eanCode.length != 13) { return false; } // Get the check number originalCheck = eanCode.substring(eanCode.length - 1); eanCode = eanCode.substring(0, eanCode.length - 1); // Add even numbers together even = Number(eanCode.charAt(1)) + Number(eanCode.charAt(3)) + Number(eanCode.charAt(5)) + Number(eanCode.charAt(7)) + Number(eanCode.charAt(9)) + Number(eanCode.charAt(11)); // Multiply this result by 3 even *= 3; // Add odd numbers together odd = Number(eanCode.charAt(0)) + Number(eanCode.charAt(2)) + Number(eanCode.charAt(4)) + Number(eanCode.charAt(6)) + Number(eanCode.charAt(8)) + Number(eanCode.charAt(10)); // Add two totals together total = even + odd; // Calculate the checksum // Divide total by 10 and store the remainder checksum = total % 10; // If result is not 0 then take away 10 if (checksum != 0) { checksum = 10 - checksum; } // Return the result if (checksum != originalCheck) { return false; } return true; } Source: http://www.logikdev.com/2010/05/13/validate-your-ean-barcode/
  13. I am building an item entry form where the user will need to submit a products corresponding UPC (11 or 12 digit upc) with the check digit. I am looking for a way, in caspio, to verify that the check digit is correct. For example, to calculate the check digit for UPC 82546692620 I will take the sum of all the odd position digits (8+5+6+9+6+0=34) I will multiply the sum by 3 (34 * 3 = 102) I will take the sum of all the even position digits (2+5+6+2+2=16) I will add the result of step 2 with step 3 (102+16=118) I will divide the sum of step 4 by 10 (118/10=11.8 or 11 remainder 8) I will take the remainder of step 5 and subtract from 10 (10-8=2) The resulting check digit for 82546692620 is 2 I have two fields that the user will populate - UPC and UPC Check Digit. I would need to calculate the result above and ensure it is equal to the check digit entered by the user. If not equal, the form should not submit. Any assistance would be most appreciated and helpful.
  14. Hi Xiang, Sorry for the delay. I have been out of the office on a trip. I will explain how the page works and the expected results: The store enters all submission information (subname, store# and store name) these fields are not linked to the script. The store selects the vendor name and enters the invoice number. The store then enters the total amount of the invoice in the invoice amount field. The store then needs to select the type of order that was placed. If the store selects "Donation" or "Store Expense" the only other action required is to attach the invoice and submit. There are no corresponding register transactions for these two options and thus the fields remain inactive. The script to check the total of register transactions to invoice amount should not run. Register transactions will always = 0.00 in this case. If the store selects "Pass Thru" the register transaction fields become active and the store is required to enter the transaction information. This is when the script should run to check that the total of the transactions entered is equal to the invoice amount entered in the previous Invoice Amount field. The store then attached the invoice and clicks submit. If the balance is equal the invoice amount the form will submit if not they will get an error message to correct. Thank you for your continued assistance with this.
  15. Hi Xiang, I removed the Return false, click OK when the message appears but it then returned that my balances did not equal when my selection was donation. I saved the changes so that you would be able to see the page if you needed to.
  16. Hi Xiang, The script does work. The only thing is it does not allow for the user to submit an invoice as a Store Expense or a Donation invoice. When the other options are selected the error to go back and select Pass Thru appears. Thank you again for taking time and helping me solve this.
  17. HI Xiang, The name of the field is OrderType. The options are Pass Thru, Donation, Store Expense. The link to the page is as follows: http://b6.caspio.com/dp.asp?AppKey=87523000c35cff3098294fcd9a59
  18. Hi Xiang, Thank you for your response. The script did work to determine if the user had checked any of the radio buttons. What I was looking for is to only execute the calculation script if the "pass thru" option specifically was selected. If "donation" or "Store Expense" was selected then the calculation script would not run to compare invoice amount with transaction total.
  19. Oh sorry about that and thank you for letting me know. I have copy and pasted the existing script below: <!-- JAVASCRIPTING --> <!-- Calculation script --> <SCRIPT LANGUAGE="JavaScript"> function calculate() { /* Retrieve the value of the field Transaction_Total and store in a variable 'v_trans' */ var v_trans = parseFloat(document.getElementById("InsertRecordVInvoice1Amount").value); /* Retrieve the value of the field Invoice1 and store in a variable 'v_invoice1' */ var v_invoice1 = parseFloat(document.getElementById("InsertRecordTTotal1").value); /* Retrieve the value of the field Invoice2 and store in a variable 'v_invoice2' */ var v_invoice2 = parseFloat(document.getElementById("InsertRecordTTotal2").value); /* Retrieve the value of the field Invoice3 and store in a variable 'v_invoice3' */ var v_invoice3 = parseFloat(document.getElementById("InsertRecordTTotal3").value); /* Retrieve the value of the field Invoice4 and store in a variable 'v_invoice4' */ var v_invoice4 = parseFloat(document.getElementById("InsertRecordTTotal4").value); /* Retrieve the value of the field Invoice5 and store in a variable 'v_invoice5' */ var v_invoice5 = parseFloat(document.getElementById("InsertRecordTTotal5").value); /* Retrieve the value of the field Invoice6 and store in a variable 'v_invoice6' */ var v_invoice6 = parseFloat(document.getElementById("InsertRecordTTotal6").value); /* Retrieve the value of the field Invoice7 and store in a variable 'v_invoice7' */ var v_invoice7 = parseFloat(document.getElementById("InsertRecordTTotal7").value); /* Retrieve the value of the field Invoice8 and store in a variable 'v_invoice8' */ var v_invoice8 = parseFloat(document.getElementById("InsertRecordTTotal8").value); /* Retrieve the value of the field Invoice9 and store in a variable 'v_invoice9' */ var v_invoice9 = parseFloat(document.getElementById("InsertRecordTTotal9").value); /* Retrieve the value of the field Invoice10 and store in a variable 'v_invoice10' */ var v_invoice10 = parseFloat(document.getElementById("InsertRecordTTotal10").value); /* Retrieve the value of the field Invoice11 and store in a variable 'v_invoice11' */ var v_invoice11 = parseFloat(document.getElementById("InsertRecordTTotal11").value); /* Retrieve the value of the field Invoice12 and store in a variable 'v_invoice12' */ var v_invoice12 = parseFloat(document.getElementById("InsertRecordTTotal12").value); /* Retrieve the value of the field Invoice13 and store in a variable 'v_invoice13' */ var v_invoice13 = parseFloat(document.getElementById("InsertRecordTTotal13").value); /* Retrieve the value of the field Invoice14 and store in a variable 'v_invoice14' */ var v_invoice14 = parseFloat(document.getElementById("InsertRecordTTotal14").value); /* Retrieve the value of the field Invoice15 and store in a variable 'v_invoice15' */ var v_invoice15 = parseFloat(document.getElementById("InsertRecordTTotal15").value); /* Add all invoices and freight charged and store in variable v_invtotal */ var v_invtotal = (v_invoice1 + v_invoice2 + v_invoice3 + v_invoice4 + v_invoice5 + v_invoice6 + v_invoice7 + v_invoice8 + v_invoice9 + v_invoice10 + v_invoice11 + v_invoice12 + v_invoice13 + v_invoice14 + v_invoice15); /*Check if v_invtotal = v_trans*/ if ( v_invtotal == v_trans) { /* Insert a value of the variable v_invtotal into the DataPage field Invoice_Total */ document.getElementById("InsertRecordTotalTransaction").value = v_invtotal; } else { alert('Invoice Total does not equal Transaction Totals. Please re-enter values'); } } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=calculate; </SCRIPT>
  20. I have this existing java script that does a check to see that the net of the invoices entered is equal to the transaction amount entered. I would like to add a condition that this should only execute if the order type is equal to "Pass Thru". Pass Thru is one of three options on a radio button field. Your assistance would be much appreciated! I have attached the existing java script below.
  21. Thank you so much Jan! It works beautifully!! Thank you!
  22. Hi Jan, Thank you so much for helping! Would I put this in the header or footer of my data page? Does it matter? Also, will a comma have an effect on this portion in red: if (selection=="30 - Athletics") second_selection = "V1 - Sort By Date, Item Detail";
×
×
  • Create New...