Results 1 to 2 of 2

Thread: display computed value (on blur) in cell

  1. #1
    Join Date
    Jan 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default display computed value (on blur) in cell

    This might have been answered but still asking

    there are say 2 fields

    Qty
    rate

    I am computing product cost on blur event nd displaying in 3rd field
    say pcost

    For this I have defined 3 text fields
    qty
    rate
    pcost

    how can i display pcost without defining a field i.e. in a cell

  2. #2
    Join Date
    May 2008
    Posts
    144
    Thanks
    6
    Thanked 11 Times in 11 Posts

    Default

    add an id to the cell, then add an onblur event to the rate field, like this:
    Code:
    <td id="pcost"></td>
    and
    Code:
    <input type="text" name="qty" id="qty">
    <input type="text" name="rate" id="rate" onblur="document.getElementById('pcost').innerHTML = document.getElementById('qty').value * document.getElementById('rate').value">

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
  •