P
PrinceMhul
I have multiple functions that I am trying to get to work based on what
my textbox says. If the textbox says "1" then I want the function
"revealit1()" to be called. If it says 2, I want "revealit2()" to be
called. But it doesn't seem like it wants to work. Maybe I'm doing
something wrong, but I'm so new to javascript - I'm probably
overlooking something.
----start code----
function revealcontrol(){
var txt = document.getElementById('whatreveal');
if(txt='1'){revealit1()}
else if(txt='2'){revealit2()}
else if(txt='3'){revealit3()}
}
----end code----
The basis of what I'm trying to do can be seen at:
www.cnex.us/sandbox/demo.html
(so far my site only works in firefox...)
If you click one of the links, 1 - 2 - 3 - 4 - 5 etc, it calls it's
corrisponding revealit1() revealit2() etc function, which then reveals
pictures below. Then, the listbox that says "Foward" is which way I
want the characters to face when you select them. Right now, it has
onChange revealit1(), which takes the user BACK to LINK 1. What I want
to eventually do (the reason why I need the code) is set it so that
when you click the link "1", it sets a textbox to a certain text (or
even a listbox to a certain selected), and THEN when you go to change
the listbox that says "foward", it will just call the function that is
in the textbox that was preset in there.
So for instance. If you click link "1", it would set the textbox to
textbox1.value='1'
Then, if you change the listbox "Foward" to something else, it will
call "revealcontrol()" function which has the JS I posted above, with
else if statements such as "If textbox = 1 then call function1(), else
if textbox=2 then call function2(), etc etc"
Someone told me usenet was awesome and I'd get an awesome answer so
don't let me down!
Thanks!
my textbox says. If the textbox says "1" then I want the function
"revealit1()" to be called. If it says 2, I want "revealit2()" to be
called. But it doesn't seem like it wants to work. Maybe I'm doing
something wrong, but I'm so new to javascript - I'm probably
overlooking something.
----start code----
function revealcontrol(){
var txt = document.getElementById('whatreveal');
if(txt='1'){revealit1()}
else if(txt='2'){revealit2()}
else if(txt='3'){revealit3()}
}
----end code----
The basis of what I'm trying to do can be seen at:
www.cnex.us/sandbox/demo.html
(so far my site only works in firefox...)
If you click one of the links, 1 - 2 - 3 - 4 - 5 etc, it calls it's
corrisponding revealit1() revealit2() etc function, which then reveals
pictures below. Then, the listbox that says "Foward" is which way I
want the characters to face when you select them. Right now, it has
onChange revealit1(), which takes the user BACK to LINK 1. What I want
to eventually do (the reason why I need the code) is set it so that
when you click the link "1", it sets a textbox to a certain text (or
even a listbox to a certain selected), and THEN when you go to change
the listbox that says "foward", it will just call the function that is
in the textbox that was preset in there.
So for instance. If you click link "1", it would set the textbox to
textbox1.value='1'
Then, if you change the listbox "Foward" to something else, it will
call "revealcontrol()" function which has the JS I posted above, with
else if statements such as "If textbox = 1 then call function1(), else
if textbox=2 then call function2(), etc etc"
Someone told me usenet was awesome and I'd get an awesome answer so
don't let me down!