What I am trying to do is retrieve the record (object) in the database that is the most recent in relation to the record that the user is entering. And get a specific property of that object and use it in a simple subtraction conditional statement.
JavaScript:
<script type="text/javascript">
$('#DialogTime').dialog({
autoOpen: false,
width: 600,
modal: true,
buttons: {
"Confirm": function () {
$("#DSCreateForm").submit();
},
"Cancel": function () { $(this).dialog("close"); }
}
});
$('.btnSubmitDS').on("click", function (e) {
// this is where the conditional statement needs to be.
{
e.preventDefault();
$(function () {
$('#DialogHighFlightTime').dialog('open')
});
}
});
</script>
Now, the view that has this script on it, is a form... and once the user hits submit, the record they just submitted will become the last row in the table.. so I need to get the property value from the row above the one the user just entered.
I know how to write the conditional statement.. I just need to know how to retrieve the right record.
I might be going about this all wrong, but I don't know how else to retrieve record that is closest to the record that the user just entered.
Any help is appreciated.