Click to See Complete Forum and Search --> : Form element referencing
Please take a look at this page.
http://www15.brinkster.com/gyp/sample.htm
I have trouble creating 5 repetition of "Paint Name" combo box. How do I create them while maintaining that selection on the paint company will alter all 5 combo box value according?
How can I also fill in value associated with a certain kind of paint into those textbox when a particular paint is selected from the combo box. I prefer not to hard code the element name since the number of repetition depends on the number of records pulled from the database.
Thanks in advance.
khalidali63
05-07-2003, 09:06 PM
The 2 links below should help you achieve what you are trying to do.
http://68.145.35.86/skills/javascripts/MultipleListBoxResult3rdListBox.html
http://68.145.35.86/skills/javascripts/ListBoxDynamicallySelectAll.html
Thanks for the links, khalidali63.
What about the part where I select a particular paint, and the values associated with the paint are filled into the textboxes automatically on the row which the combo box value changes.
For example,
Jotun, Chromo primer have
20 vs(%)
19.26 paint unit price
1.03 thinner unit price
dft, wastage (%) and estimated coverage are input field
the rest are auto calculated fields
The javascript coding portion isn't inside since I do not know how to approach it.
Thanks in advance.
khalidali63
05-07-2003, 11:10 PM
To appropriately answer this question,I must know how and from whre the values will be retrieved to put in to the fields.
typically,say you hve tosource that will give all od those values,
you can do something like this.
get listbox value
match it with the source
retrieve the relative fields values
and pput them in the fields
document.formName.fieldname.value = values[x]
assuming values will be in an array called vcalues
Sorry but I have looked through the two link above and I don't see how it can be applied in my case. For example, the one with 3 combo boxes have identical name. In my case, I need my combo boxes to have a different name each since each row represent a different paint.
So I'm still having problem duplicating more paint combo boxes. The combo boxes are named in such an order Paint1, Paint2, Paint3... etc.
As for populating the text boxes, the values are being fetched from a database, I'm still trying to figure out how to address the elements properly so that the correct values can go into their respective row of text boxes when the value in the combo box are changed.
A note here, the number of rows are not predetermined since it depends largely on how many records there is in the database.
The amended page is located here
http://www15.brinkster.com/gyp/amended.htm
Please take a look at the javascripting since its all messed up but I did managed to load all paints and their respective values correctly. Having trouble populating the combo boxes and the text boxes.
Thanks in advance.
Anyone can help a n00b out? I hope I'm not breaking any rules "bumping" this up.
Thank you.
havik
05-08-2003, 09:40 PM
In regards to the subject of the thread, "Form element referencing", the following link should prove useful (and subsequent lessons)
http://codepunk.hardwar.org.uk/ajs15.htm
Havik