Search the Community

Showing results for tags 'editrecord'.



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

Found 2 results

  1. So I'm trying to get the value that is already in the current points field, do a calculation as depicted in the switch statement and then fill the field in again with the new number before submitting instantly. This is all supposed to be done as a way of replacing an SQL update statement. For some reason my EditRecord or document.getElementById doesn't seem to be working at all. <script LANGUAGE="Javascript"> function calculate(){ var pos = [@pos]; var points = [@field:CurrentPoints#]; switch(pos) { case 1: points += 10; break; case 2: points += 8; break; case 3: points += 6; break; case 4: points += 4; break; case -2: points += -2; break; default: points += 2; } document.getElementById("EditRecordCurrentPoints").innerHTML = points; } document.getElementById("mypage").onsubmit=calculate(); </script> There is already a <div id="mypage"> in the header and a </div> in the footer. Am I just being very stupid?
  2. I see many JS examples, but none addressing multiple datapages on the same webpage. I have two text variables that I want to concatenate in the 3rd datapage on my update webpage. I'm using the code attached in the footer of the detail page to no avail. I've tried several alternatives on the last line but none worked. The error associated with the last line below is "Object doesn't support property or method 'getElementById'. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var temp11 = document.getElementById("EditRecordWhere_Sa").value; var temp12 = document.getElementById("EditRecordWhere_Su").value; var temp10 = temp11 + temp12; document.getElementById("EditRecordWhere_Text").value = temp10; } document.forms[2].getElementById("Mod0EditRecord").onmouseover=concatenate; </SCRIPT>