HighDots Forums  

function isn't working for some reason! =(

Javascript JavaScript language (comp.lang.javascript)


Discuss function isn't working for some reason! =( in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PrinceMhul@gmail.com
 
Posts: n/a

Default function isn't working for some reason! =( - 09-02-2006 , 10:53 PM






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


Reply With Quote
  #2  
Old   
PrinceMhul@gmail.com
 
Posts: n/a

Default Re: function isn't working for some reason! =( - 09-02-2006 , 11:52 PM






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


Reply With Quote
  #3  
Old   
Evertjan.
 
Posts: n/a

Default Re: function isn't working for some reason! =( - 09-03-2006 , 11:53 AM



wrote on 03 sep 2006 in comp.lang.javascript:

Quote:
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)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.