Jump to content
  • 0

Update field base on Entry


NeoInJS

Question

Hello - Can you please check my script below? Before updating an entry in a DETAILS page, I need to make an entry check to make sure that the entered items is not greater than the limits (stored in calculated fields).

 

NOTE: The details page' datasource table is a table view.

 

I have this script placed in the details page Footer.

 

<script type="text/javascript">
function EntryCheck()
{
var D='[@calcfield:7]';
var W='[@calcfield:8]';
var F='[@calcfield:9]';
 
var enteredDiapers = parseInt(document.getElementById("EditRecordFulfilled_Items_Item_qty_Diapers").value);
 var enteredWipes = parseInt(document.getElementById("EditRecordFulfilled_Items_Item_qty_Wipes").value);
var enteredFormula = parseInt(document.getElementById("EditRecordFulfilled_Items_Item_qty_Formula").value);
 
if ((enteredDiapers>D) || (enteredWipes>W) || (enteredFormula>F)))
    {
      alert("Actual fulfilled entry should not excess requested essentials");
     }
}
document.getElementById('caspioform').onsubmit=EntryCheck;
</script>
 

Datapage: https://c2arw288.caspio.com/dp.asp?AppKey=da284000b8cdf3ba492b42b8bde9&Request_ID=1

UN: part@mail.com

PW: test

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...