Jump to content

two different tables and linking fields

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 post
Share on other sites
17 minutes ago, papajoejo86 said:

i have two tables Loan Application table and Loans table

Are you talking about HTML tables on the screen or database tables?

Link to post
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.

Link to post
Share on other sites

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>
<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() > '')

         <input type='text' name='status' id='status' value='Pending'>
         Date approved<br>
         <input type='date' name='approved' id='approved'>


Link to post
Share on other sites

Join the conversation

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

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.