Click to See Complete Forum and Search --> : how to ADD value from drop down list ?


86rayl
10-02-2006, 01:40 PM
I am now building a web page that require a function of drop down lists which
will allow the calculation button to add all of the selected item value from each of the drop down list box, and show the final value in the text box.

i need to put different cpu item in the cpu list, and different ram item into ram list, display card item into its list... and so on... each item has a different cost, from the user end, after all of the selection from each category, a calculate button can retrieve the cost from each drop down list item and add
all of the value and show it into a text box... now, how can i achieve this?

can anyone give me guide and some sample code i may take it as a reference of ? thank you in advance.

Sincerely
Raymond

Terrorke
10-03-2006, 01:34 AM
You can use javascript for this. Here is some example code :

<select name="select" id="Selectelement"></select>

document.forms[0].Selectelement.options[0] = new Option('selectedvalue','displayvalue');

You can us some sort of event to trigger the add like onSubmit(), onclick(), onload(),...


Hopes this helps you on the way.

86rayl
10-03-2006, 03:15 AM
Can u give me a complete guideline for this function.

1. Connection to a database. MYSQL or ACCESS ?
2. How to extract data from the database and how to implemented to my
drop down list.
3. In the webpage, how can i name the component so they can correspond to each other, for drop down list, , a button and a text field.

i would like to use ASP + VBSCRIPT to achieve this, thank you for all the help.

RAY