Jump to content

VVMustang

Members
  • Posts

    6
  • Joined

  • Last visited

VVMustang's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I can't figure out why these three functions aren't working. They only work one at a time. How do I run multiple functions on a .onsubmit? What's the syntax? function calculate() { var quantity = parseFloat(document.getElementById("EditRecordDirectory_Quan").value); var price = parseFloat(10); var total = parseFloat(quantity * price); var quantity2 = parseFloat(document.getElementById("EditRecordBrick_Quan").value); var price2 = parseFloat(50); var total2 = parseFloat(quantity2 * price2); if (document.getElementById('EditRecordGuardian_Membership').checked) {document.getElementById('EditRecordMembership_Fees').value = 15;} else {document.getElementById('EditRecordMembership_Fees').value = 0;} if(isNaN(quantity)) {document.getElementById("EditRecordDirectory_Fees").value = 0;} else {document.getElementById("EditRecordDirectory_Fees").value = Math.round(total);} if(isNaN(quantity2)) {document.getElementById("EditRecordBrick_Fees").value = 0;} else {document.getElementById("EditRecordDirectory_Fees").value = Math.round(total2);} } document.getElementById("caspioform").onsubmit=calculate;
  2. Okay, I made the following modification (see below), with the same error (document.getElementBy....is null). The script is in the footer of the datapage. function calculate_directory() { var quantity = parseFloat(document.getElementById("EditRecordDirectory_Quan").value); var price = parseFloat(10); var total = parseFloat(quantity * price); if(!isNaN(quantity)) {document.getElementById("EditRecordDirectory_Fee").value = 0;} else {document.getElementById("EditRecordDirectory_Fee").value = Math.round(total);} } document.getElementById("caspioform").onsubmit=calculate_directory;
  3. Here's another one I'm having trouble making work. I want to ask for a quantity and then fill in the fee based on the quantity answer. If the quantity is 0 the fee will be 0 if the quantity is 4 the fee will be $40. The error is "document.getElementId("EditRecordDirectory_Fee") is null function calculate() { var quantity = parseFloat(document.getElementById("EditRecordDirectory_Quan").value); var price = parseFloat(10); var total = parseFloat(quantity * price); if (quantity == 0) {document.getElementById("EditRecordDirectory_Fee").value = 0;} else {document.getElementById("EditRecordDirectory_Fee").value = Math.round(total);} } document.getElementById("caspioform").onsubmit=calculate;
  4. I'm trying to insert values in fields in an Submission Page based on the values of adjacent fields. The script is in the Footer. It is not working. The Organizer_Fee, Yearbook_Fee and BookClub_Fee are being populated with the "Yes" value every time. Here's my script: function calculate() { var order_organizer = (document.getElementById("InsertRecordOrganizer")); var order_yearbook = (document.getElementById("InsertRecordYearbook")); var order_bookclub = (document.getElementById("InsertRecordBookClub")); if (order_organizer = "Yes") { document.getElementById("InsertRecordOrganizer_Fee").value = (10); } else { document.getElementById("InsertRecordOrganizer_Fee").value = (0); } if (order_yearbook = "Yes") { document.getElementById("InsertRecordYearbook_Fee").value = (25); } else { document.getElementById("InsertRecordYearbook_Fee").value = (0); } if (order_bookclub = "Yes") { document.getElementById("InsertRecordBookClub_Fee").value = (50); } else { document.getElementById("InsertRecordBookClub_Fee").value = (0); } } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=calculate;
  5. Is it possible to hash passwords that are stored in a Caspio database? Is this necessary? How do I know that my database won't fall into the wrong hands and be used maliciously?
  6. I have a script that appears to be written correctly. I cannot find any reason why it should not work. However it is not receiving or submitting a parameter. The variables prehtml and posthtml appear in the table in the field NewsTitleformatted, but the text from NewsTitle is missing. For example, if the data for NewsTitle is entered as Promotion Received, the data in the NewsTitleformatted field appears as . The "Promotion Received" text is not there. The script is: function Headline() { var between = document.getElementById("InsertRecordNewsTitle").value; var prehtml = ""; var posthtml = ""; var bold = prehtml + between + posthtml; document.getElementById("InsertRecordNewsTitleformatted").value=bold; } document.getElementById("caspioform").onsubmit=Headline();
×
×
  • Create New...