Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- $('#billing_table tr').each(function() {
- var checked = $(this).find($(".billed-select")).val();
- console.log(checked);
- if(checked != "1") {
- $('.paid').attr('disabled', true);
- } else {
- $('.paid').attr('disabled', false);
- }
- });
- });
- <table id="billing_table">
- <thead>
- <tr>
- <td style="display: none">Account</td>
- <td>Collector Name</td>
- <td>Customer</td>
- <td>Bill Date</td>
- <td>Days Until<br>Next Action</td>
- <td>Next Action</td>
- <td>Billed</td>
- <td>Bill<br>Amount</td>
- <td>Payment<br>Due Date</td>
- <td>Notes</td>
- <td>Paid</td>
- <td>Save</td>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach ($dbh->query($bill) as $rows) {
- ?>
- <tr class="row">
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <?php if ($rows ['Billed Status'] == 'Billed') {?>
- <td>
- <select class="billed-select">
- <option class="selection" value="1" selected>Yes</option>
- <option class="selection" value="0">No</option>
- <option class="selection" value="2">Exempt</option>
- </select>
- </td>
- <?php } else if ($rows ['Billed Status'] == 'Unbilled'){ ?>
- <td>
- <select class="billed-select">
- <option class="selection" value="1">Yes</option>
- <option class="selection" value="0" selected>No</option>
- <option class="selection" value="2">Exempt</option>
- </select>
- </td>
- <?php } else if ($rows ['Billed Status'] == 'Exempt'){ ?>
- <td>
- <select class="billed-select">
- <option class="selection" value="1">Yes</option>
- <option class="selection" value="0">No</option>
- <option class="selection" value="2" selected>Exempt</option>
- </select>
- </td>
- <?php } ?>
- <td></td>
- <td></td>
- <td></td>
- <?php if ($rows ['Payment Status'] == 'Paid') {?>
- <td align="center"><input type="checkbox" id="paid" class="paid" name="paid" checked></td>
- <?php } else { ?>
- <td align="center"><input type="checkbox" id="paid" class="paid" name="paid"></td>
- <?php } ?>
- <td></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
Add Comment
Please, Sign In to add comment