2

I need a form with a simple items catalog, user will enter quantities for each item and it will auto calculate sub total and total using javascript.

I am looking something like this:

Name: _

Email: _

Address: _

please select your items:

ID | Name | Price | Quantity | Sub Total

1 | Item 1 | $10 | [_] |

2 | Item 2 | $10 | [_] |

3 | Item 3 | $10 | [_] |

Total |

[Submit]

Is there some module available to develop this kind of form, or I'll have to develop some custom module? I tried with Webform module but with no luck.

Thanks

2 Answers 2

1

I did it myself with the help of webform, webform_table_element module and by implementing a couple of hooks and a little jQuery snippet. A complete howto can be found here:

Drupal 7 Webform with an item catalog table element

Thanks.

0

If the Webform module gets you close to the result you want you could try altering the created form and adding additional bits that you need with hook_form_alter(). Creating a custom module and form is always an option and will offer you the most flexibility, but it might be quite a bit more work depending of your needs. If you start working with Drupal forms on the code level you can check out the Form API Reference page for a good source of information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.