SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery calculate form php

    how get id="cb<?= $i?>" ?

    <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    <script type="text/javascript">

    $(document).ready(
    function() {
    $('#cb').change(
    function() {
    var amount = $('#principal_amount').val()*$('#principal_installment').val();
    $('#amount').val(amount);
    }
    );
    }
    );

    </script>
    <tr>
    <td><input type="checkbox" name="id[]" value="<?= $row2["id_principal_payment"]?>" id="cb<?= $i?>" onclick="isChecked(this.checked);" />
    </td>

    Thx,

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ronggolawe View Post
    how get id="cb<?= $i?>" ?
    Do you want a particular one that starts with "cb" or do you want all the ones that start with "cb"
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •