Jump to content

Calculating fields using jQuery


playaz

Recommended Posts

Hi guys,

 

I am building a form that will automatically calculate the values entered by a user ideally using jQuery/javascript, i am not sure how to do this but have a general idea of the logic required (i am no expert so feel free to correct me) - I have created a dummy image to help explain what I am trying to do.

 

http://img399.imageshack.us/my.php?image=tablehw2.png

 

I have a single form, which has two tables each with form fields that automatically calculate the total amount for each table provided it has been selected.

Using jQuery - I would expect the logic to be something like -

i) Find the table element

ii) Find all the text fields within the table that have a value

iii) Add these together and display in the 'total' form field within the last row of each table

 

While i'm ok on the PHP, javascript is something I still get confused with at times - I would appreciate any help on doing this, and if possible a quick overview to help me learn from the code.

 

Thanks in advance

 

Gaz

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.