By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

function isn't working for some reason! =(

P: n/a
var objListBox = document.getElementById('catalist');
var val = objListBox[objListBox.selectedIndex].value;
var txt = dyevalue00.value;
document.getElementById(val).value = txt;

To explain real quick, this is for a character maker.
The "catalist" is a listbox with different values such as "Body1" -
"Head" - "Shoes" - "Hair" etc
"dyevalue00" is a textbox
I have many textboxes that are named the same as the "catalist" values
(like textboxes named Body1 - Head - Shoes - Hair - etc..

So whatever is selected in "CataList" (let's say Hair) I want that
textbox to equal what another textbox of mine equals. So if the
selected value on CataList is "hair", then I want the textbox that has
the id of "hair" to equal whatever is inside the textbox with the id of
"dyevalue00".

I must be doing something wrong in my code, since this is n't working.
UseNet rocks so I know someone out there will know :D

Sep 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
What I mean by it isn't working is it isn't doing what I intended it to
do. Since I'm new at javascript, everything I do is trial and error.
And if I error too much, I post on here - lol.

What I really need is a way to make it so that if the selected index on
listbox1.value="text1" then I can make the textbox named "text1" (which
text1 is from the listbox.value) equal another textbox's value.

Not sure how to do that though

Sep 3 '06 #2

P: n/a
wrote on 03 sep 2006 in comp.lang.javascript:
What I mean by it isn't working is it isn't doing what I intended it to
do. Since I'm new at javascript, everything I do is trial and error.
And if I error too much, I post on here - lol.

What I really need is a way to make it so that if the selected index on
listbox1.value="text1" then I can make the textbox named "text1" (which
text1 is from the listbox.value) equal another textbox's value.

Not sure how to do that though
Are you anwering on something?

Please quote what you are replying to.

<http://www.safalra.com/special/googlegroupsreply/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.