Jump to content

Recommended Posts

i have two tables Loan Application table and Loans table. There is status option and date loan was applied section. After status has been chosen as Pending from the dropdown field and date chosen and loan application saved, it goes under the loans section.

Now, admin has to go and approve the loan and pick the date the loan was approved under the loans section but date can be chosen for the approved date but the status cant be changed to approve because it shows pending. Please what can i do so when i select the date for approval , the status should change to approved automatically

Link to comment
https://forums.phpfreaks.com/topic/312365-two-different-tables-and-linking-fields/
Share on other sites

When the admin adds an approval date, update the date and status in your tables when saved.

If you want immediately to alter the status display on screen, use a javascript onchange event on the date input to change the status to Approved.

Here's an example of the javascript pprocessing. (I don't know what your tables look like to give you an example of the update.)

<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta http-equiv="content-language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- link to jquery functions -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script type='text/javascript'>
    $().ready( function() {
        $("#approved").change( function() {
            if ($(this).val() > '')
                $("#status").val("Approved")
            else
                $("#status").val("Pending")
        })
    })
</script>

</head>
<body>
         Status<br>
         <input type='text' name='status' id='status' value='Pending'>
         <br><br>
         Date approved<br>
         <input type='date' name='approved' id='approved'>
</body>
</html>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.