Hi,
try using my code in the footer of the datapage:
<SCRIPT LANGUAGE="JavaScript">
function check()
{
var v_cost = parseFloat(document.getElementById("InsertRecordFirst_field").value);
var v_retail = parseFloat(document.getElementById("InsertRecordSecond_field").value);
if(v_cost>v_retail) {
window.alert("Cost must be less");
return false;
}
}
document.getElementById("caspioform").onsubmit=check;
</SCRIPT>
Replace First_field with field name where you store cost, and Second_field with field name where you store retail amount.
Hope it helps!