Results 1 to 2 of 2

Thread: auto add pre defined input fields in a form and total the same dynamically

  1. #1
    Join Date
    Nov 2007
    Posts
    69
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Default auto add pre defined input fields in a form and total the same dynamically

    hi forum
    i have a form in which i have four input fields for pieces to be entered and 4 fields for amount
    what i want is that the first pieces-t1 should be visible and rest three should not show up on the form unless asked for.
    can anyone suggest me a way to do this
    i have come across a lot of help areas where we can add input fields but in my case i have only predefined 3 fields
    the code is below
    Code:
    <td>Pieces-t1</td>
    <td><input type="text" name="txttp1" tabindex="5"  size="4" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    
    Amount-t1
    <input type="text" name="txttamt1" tabindex="5"  size="6" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    </td>
    </tr>
    <tr>
    <td>
    
    Pieces-t2
    </td>
    <td>
    <input type="text" name="txttp2" tabindex="5"  size="4" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    
    Amount-t2
    <input type="text" name="txttamt2" tabindex="5"  size="6" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    </td>
    </tr><tr>
    <td>
    
    Pieces-t3
    </td>
    <td>
    <input type="text" name="txttp3" tabindex="5"  size="4" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    
    Amount-t3
    <input type="text" name="txttamt3" tabindex="5"  size="6" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    </td></tr><tr>
    <td>
    
    Pieces-t4
    </td>
    <td>
    <input type="text" name="txttp4" tabindex="5"  size="4" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    
    Amount-t4
    <input type="text" name="txttamt4" tabindex="5"  size="6" onfocus="this.style.backgroundColor='#C6AEC7';" onblur="this.style.backgroundColor='#FAF8CC';"></font>
    </td></tr>
    can you guys suggest me some solution for this?
    also is there any way i can get the total of pieces and amount at the end
    and a grand total being total pieces*amount
    smile always
    anand
    Last edited by meenakshi; 06-10-2008 at 06:43 PM. Reason: more information to be added

  2. #2
    Join Date
    Nov 2007
    Posts
    69
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Default

    hi
    i think i have not clearly stated what i was looking for
    i will try to do this againple bear with me
    what i want is that the input fields
    pieces-t1 and amount-t1 should be visible
    rest three pieces-t2,t3,t4 and amount-t2,t3,t4 should not show initially
    when i click on add button one filed should show up that is t2 and then t3 and then t4 when clicked but t4 fields are the end.i dont want to go ahead with adding more fields
    smile always
    anand

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
  •